本文整理汇总了C++中eigen::Array::row方法的典型用法代码示例。如果您正苦于以下问题:C++ Array::row方法的具体用法?C++ Array::row怎么用?C++ Array::row使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eigen::Array
的用法示例。
在下文中一共展示了Array::row方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: convert_symmetric_fermion_mixings_to_slha
void SLHA_io::convert_symmetric_fermion_mixings_to_slha(Eigen::Array<double, N, 1>& m,
Eigen::Matrix<std::complex<double>, N, N>& z)
{
for (int i = 0; i < N; i++) {
// check if i'th row contains non-zero imaginary parts
if (!is_zero(z.row(i).imag().cwiseAbs().maxCoeff())) {
z.row(i) *= std::complex<double>(0.0,1.0);
m(i) *= -1;
}
}
}
示例2: extractInternalFaces
void extractInternalFaces(const UnstructuredGrid& grid,
Eigen::Array<int, Eigen::Dynamic, 1>& internal_faces,
Eigen::Array<int, Eigen::Dynamic, 2, Eigen::RowMajor>& nbi)
{
typedef Eigen::Array<bool, Eigen::Dynamic, 1> OneColBool;
typedef Eigen::Array<int, Eigen::Dynamic, 2, Eigen::RowMajor> TwoColInt;
typedef Eigen::Array<bool, Eigen::Dynamic, 2, Eigen::RowMajor> TwoColBool;
TwoColInt nb = faceCells(grid);
// std::cout << "nb = \n" << nb << std::endl;
// Extracts the internal faces of the grid.
// These are stored in internal_faces.
TwoColBool nbib = nb >= 0;
OneColBool ifaces = nbib.rowwise().all();
const int num_internal = ifaces.cast<int>().sum();
// std::cout << num_internal << " internal faces." << std::endl;
nbi.resize(num_internal, 2);
internal_faces.resize(num_internal);
int fi = 0;
int nf = numFaces(grid);
for (int f = 0; f < nf; ++f) {
if (ifaces[f]) {
internal_faces[fi] = f;
nbi.row(fi) = nb.row(f);
++fi;
}
}
}
示例3: convert_symmetric_fermion_mixings_to_hk
void SLHA_io::convert_symmetric_fermion_mixings_to_hk(Eigen::Array<double, N, 1>& m,
Eigen::Matrix<std::complex<double>, N, N>& z)
{
for (int i = 0; i < N; i++) {
if (m(i) < 0.) {
z.row(i) *= std::complex<double>(0.0,1.0);
m(i) *= -1;
}
}
}