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?