Region Aliasing Error

527 views
Skip to first unread message

Shreya Chakraborty

unread,
Jul 24, 2017, 3:15:47 PM7/24/17
to Ceres Solver
While working on a problem, I am getting the following error:

F0725 00:27:23.114425 10218 problem_impl.cc:77] Check failed: !RegionsAlias(existing_block, existing_block_size, new_block, new_block_size) Aliasing detected between existing parameter block at memory location 0x252c580 and has size 4 with new parameter block that has memory address 0x252c588 and would have size 4.
*** Check failure stack trace: ***
    @     0x7fcf63906daa  (unknown)
    @     0x7fcf63906ce4  (unknown)
    @     0x7fcf639066e6  (unknown)
    @     0x7fcf63909687  (unknown)
    @           0x7bc3e9  ceres::internal::(anonymous namespace)::CheckForNoAliasing()
    @           0x7befdf  ceres::internal::ProblemImpl::InternalAddParameterBlock()
    @           0x7bfac5  ceres::internal::ProblemImpl::AddResidualBlock()
    @           0x7c0674  ceres::internal::ProblemImpl::AddResidualBlock()
    @           0x481b01  DfUSMC::evaluateMesh()
    @           0x474c03  main
    @     0x7fcf62735f45  (unknown)
    @           0x475750  (unknown)
    @              (nil)  (unknown)


I am unable to understand the source of the error. Here is my simple code for initializing the residual block.

for(int i=0; i<num_vertex; i++)
    {
          
        ceres::CostFunction* cost_function = CostFunctor::Create(indices_conn[i].size());
       
        problem.AddResidualBlock(cost_function, NULL, new_z + (i), other_xyz + (i*4) );

    }

Here, other_xyz and new_z is declared as:
double *new_z= new double[num_vertex];
double *other_xyz=new double[4 * num_vertex];

Can you tell me where the aliasing might be occurring?

Sameer Agarwal

unread,
Jul 24, 2017, 3:17:54 PM7/24/17
to Ceres Solver
what sized parameter blocks is the CostFunction expecting? its likely that it has the wrong sized parameter blocks specified.

--
You received this message because you are subscribed to the Google Groups "Ceres Solver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceres-solver...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/58f8e13c-7e35-4064-a6fd-7cbae09cae03%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Message has been deleted

Shreya Chakraborty

unread,
Jul 24, 2017, 3:35:15 PM7/24/17
to Ceres Solver
I just checked. I had accidentally put the size of the residuals later. It was such a silly mistake, sorry for bothering you!

Sameer Agarwal

unread,
Jul 24, 2017, 3:35:18 PM7/24/17
to Ceres Solver
your parameter blocks are swapped the cost function expects 4, 1 and you are adding as if they are 1,4.

On Mon, Jul 24, 2017 at 12:33 PM Shreya Chakraborty <shreya...@gmail.com> wrote:
The parameter blocks are of of size 1 and size 4 respectively.
Declaration within Create:

static ceres::CostFunction* Create(const int num_indices) {

        return (new ceres::AutoDiffCostFunction<CostFunctor, 1, 4, 1>(new CostFunctor(num_indices)));

    }




On Tuesday, July 25, 2017 at 12:47:54 AM UTC+5:30, Sameer Agarwal wrote:

Shreya Chakraborty

unread,
Jul 24, 2017, 3:38:03 PM7/24/17
to Ceres Solver
Yes, I realized it!
Reply all
Reply to author
Forward
0 new messages