NEMoSys  0.63.0
A modular, extensible resource with robust automated mesh generation, mesh quality analysis, adaptive mesh refinement, and data transfer between arbitrary meshes.
orthoPoly3D.C File Reference

Go to the source code of this file.

Functions

void removeColumn (MatrixXd &matrix, unsigned int colToRemove)
 
void removeColumn (const MatrixXd &matrix, MatrixXd &matrix_red, const std::vector< unsigned int > &toRemove)
 
void removeRowT (const MatrixXd &matrix, MatrixXdRM &matrix_red, const std::vector< unsigned int > &toRemove)
 

Function Documentation

◆ removeColumn() [1/2]

void removeColumn ( MatrixXd &  matrix,
unsigned int  colToRemove 
)

Definition at line 42 of file orthoPoly3D.C.

Referenced by orthoPoly3D::eval(), and orthoPoly3D::operator()().

43 {
44  unsigned int numRows = matrix.rows();
45  unsigned int numCols = matrix.cols() - 1;
46 
47  if (colToRemove < numCols)
48  matrix.block(0, colToRemove, numRows, numCols - colToRemove) =
49  matrix.rightCols(numCols - colToRemove);
50 
51  matrix.conservativeResize(numRows, numCols);
52 }

◆ removeColumn() [2/2]

void removeColumn ( const MatrixXd &  matrix,
MatrixXd &  matrix_red,
const std::vector< unsigned int > &  toRemove 
)

Definition at line 57 of file orthoPoly3D.C.

60 {
61  int m = 0;
62  for (int i = 0; i < matrix.cols(); ++i)
63  {
64  bool remove = false;
65  for (unsigned int k : toRemove)
66  {
67  if (i == k)
68  {
69  remove = true;
70  break;
71  }
72  }
73  if (!remove)
74  {
75  matrix_red.col(m) = matrix.col(i);
76  m += 1;
77  }
78  }
79 }

◆ removeRowT()

void removeRowT ( const MatrixXd &  matrix,
MatrixXdRM matrix_red,
const std::vector< unsigned int > &  toRemove 
)

Definition at line 85 of file orthoPoly3D.C.

Referenced by orthoPoly3D::computeA().

88 {
89  int m = 0;
90  for (int i = 0; i < matrix.cols(); ++i)
91  {
92  bool remove = false;
93  for (unsigned int k : toRemove)
94  {
95  if (i == k)
96  {
97  remove = true;
98  break;
99  }
100  }
101  if (!remove)
102  {
103  matrix_red.row(m) = matrix.col(i);
104  m += 1;
105  }
106  }
107 }