本文整理汇总了C++中SparseMatrix::allocate方法的典型用法代码示例。如果您正苦于以下问题:C++ SparseMatrix::allocate方法的具体用法?C++ SparseMatrix::allocate怎么用?C++ SparseMatrix::allocate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SparseMatrix
的用法示例。
在下文中一共展示了SparseMatrix::allocate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: finish_tensor_trace
void finish_tensor_trace( SpinBlock& b, SpinBlock* sysdot, SparseMatrix& sysdot_op, SparseMatrix& op, std::string& build_pattern )
{
// Build and store new operator
assert( ! op.get_built() );
op.set_built() = true;
op.set_build_pattern() = build_pattern;
//FIXME magic number 2
op.set_deltaQuantum(1, op.get_quantum_ladder().at( build_pattern ).at(2) );
op.allocate(b.get_stateInfo());
SpinAdapted::operatorfunctions::TensorTrace(sysdot, sysdot_op, &b, &(b.get_stateInfo()), op);
}
示例2: finish_tensor_product
void finish_tensor_product( SpinBlock& b, SpinBlock* sysdot,
const SparseMatrix& sysdot_op1, const SparseMatrix& sysdot_op2, SparseMatrix& op,
bool include_parity, std::string& build_pattern )
{
// Build and store new operator
assert( ! op.get_built() );
op.set_built() = true;
op.set_build_pattern() = build_pattern;
op.set_deltaQuantum(1, op.get_quantum_ladder().at( build_pattern ).at(2) );
op.allocate(b.get_stateInfo());
// Do tensor product
double parity = 1.0;
if ( include_parity ) parity = getCommuteParity( sysdot_op1.get_deltaQuantum(0), sysdot_op2.get_deltaQuantum(0), op.get_deltaQuantum(0) );
SpinAdapted::operatorfunctions::TensorProduct(sysdot, sysdot_op1, sysdot_op2, &b, &(b.get_stateInfo()), op, parity);
}