Loading Documentation/Examples/Matrices/MultidiagonalMatrix/MultidiagonalMatrixExample_Constructor.cpp +5 −3 Original line number Diff line number Diff line Loading @@ -22,11 +22,13 @@ void laplaceOperatorMatrix() auto row = matrixView.getRow( elementIdx ); if( i == 0 || j == 0 || i == gridSize - 1 || j == gridSize - 1 ) row.setElement( 2, 1.0 ); // set matrix elements corresponding to boundary grid nodes // and Dirichlet boundary conditions, i.e. 1 on the main diagonal // which is the third one else { row.setElement( 0, -1.0 ); // set matrix elements corresponding to inner grid nodes row.setElement( 1, -1.0 ); row.setElement( 2, 4.0 ); row.setElement( 0, -1.0 ); // set matrix elements corresponding to inner grid nodes, i.e. row.setElement( 1, -1.0 ); // 4 on the main diagonal (the third one) and -1 to the other row.setElement( 2, 4.0 ); // sub-diagonals row.setElement( 3, -1.0 ); row.setElement( 4, -1.0 ); } Loading Documentation/Examples/Matrices/MultidiagonalMatrix/MultidiagonalMatrixExample_Constructor_init_list_1.cpp +5 −3 Original line number Diff line number Diff line Loading @@ -21,11 +21,13 @@ void laplaceOperatorMatrix() auto row = matrixView.getRow( elementIdx ); if( i == 0 || j == 0 || i == gridSize - 1 || j == gridSize - 1 ) row.setElement( 2, 1.0 ); // set matrix elements corresponding to boundary grid nodes // and Dirichlet boundary conditions, i.e. 1 on the main diagonal // which is the third one else { row.setElement( 0, -1.0 ); // set matrix elements corresponding to inner grid nodes row.setElement( 1, -1.0 ); row.setElement( 2, 4.0 ); row.setElement( 0, -1.0 ); // set matrix elements corresponding to inner grid nodes, i.e. row.setElement( 1, -1.0 ); // 4 on the main diagonal (the third one) and -1 to the other row.setElement( 2, 4.0 ); // sub-diagonals row.setElement( 3, -1.0 ); row.setElement( 4, -1.0 ); } Loading Documentation/Examples/Matrices/MultidiagonalMatrix/MultidiagonalMatrixExample_Constructor_init_list_2.cpp +5 −5 Original line number Diff line number Diff line Loading @@ -12,13 +12,13 @@ void laplaceOperatorMatrix() const int matrixSize = gridSize * gridSize; TNL::Matrices::MultidiagonalMatrix< double, Device > matrix( matrixSize, { - gridSize, -1, 0, 1, gridSize }, { { 0.0, 0.0, 1.0 }, // set matrix elements corresponding to boundary grid nodes { 0.0, 0.0, 1.0 }, // and Dirichlet boundary conditions, i.e. 1 on the main diagonal { 0.0, 0.0, 1.0 }, // which is the third one { 0.0, 0.0, 1.0 }, { 0.0, 0.0, 1.0 }, { 0.0, 0.0, 1.0 }, { 0.0, 0.0, 1.0 }, { 0.0, 0.0, 1.0 }, { -1.0, -1.0, 4.0, -1.0, -1.0 }, { -1.0, -1.0, 4.0, -1.0, -1.0 }, { -1.0, -1.0, 4.0, -1.0, -1.0 }, // set matrix elements corresponding to inner grid nodes, i.e.4 on the main diagonal { -1.0, -1.0, 4.0, -1.0, -1.0 }, // (the third one) and -1 to the other sub-diagonals { 0.0, 0.0, 1.0 }, { 0.0, 0.0, 1.0 }, { -1.0, -1.0, 4.0, -1.0, -1.0 }, Loading Loading
Documentation/Examples/Matrices/MultidiagonalMatrix/MultidiagonalMatrixExample_Constructor.cpp +5 −3 Original line number Diff line number Diff line Loading @@ -22,11 +22,13 @@ void laplaceOperatorMatrix() auto row = matrixView.getRow( elementIdx ); if( i == 0 || j == 0 || i == gridSize - 1 || j == gridSize - 1 ) row.setElement( 2, 1.0 ); // set matrix elements corresponding to boundary grid nodes // and Dirichlet boundary conditions, i.e. 1 on the main diagonal // which is the third one else { row.setElement( 0, -1.0 ); // set matrix elements corresponding to inner grid nodes row.setElement( 1, -1.0 ); row.setElement( 2, 4.0 ); row.setElement( 0, -1.0 ); // set matrix elements corresponding to inner grid nodes, i.e. row.setElement( 1, -1.0 ); // 4 on the main diagonal (the third one) and -1 to the other row.setElement( 2, 4.0 ); // sub-diagonals row.setElement( 3, -1.0 ); row.setElement( 4, -1.0 ); } Loading
Documentation/Examples/Matrices/MultidiagonalMatrix/MultidiagonalMatrixExample_Constructor_init_list_1.cpp +5 −3 Original line number Diff line number Diff line Loading @@ -21,11 +21,13 @@ void laplaceOperatorMatrix() auto row = matrixView.getRow( elementIdx ); if( i == 0 || j == 0 || i == gridSize - 1 || j == gridSize - 1 ) row.setElement( 2, 1.0 ); // set matrix elements corresponding to boundary grid nodes // and Dirichlet boundary conditions, i.e. 1 on the main diagonal // which is the third one else { row.setElement( 0, -1.0 ); // set matrix elements corresponding to inner grid nodes row.setElement( 1, -1.0 ); row.setElement( 2, 4.0 ); row.setElement( 0, -1.0 ); // set matrix elements corresponding to inner grid nodes, i.e. row.setElement( 1, -1.0 ); // 4 on the main diagonal (the third one) and -1 to the other row.setElement( 2, 4.0 ); // sub-diagonals row.setElement( 3, -1.0 ); row.setElement( 4, -1.0 ); } Loading
Documentation/Examples/Matrices/MultidiagonalMatrix/MultidiagonalMatrixExample_Constructor_init_list_2.cpp +5 −5 Original line number Diff line number Diff line Loading @@ -12,13 +12,13 @@ void laplaceOperatorMatrix() const int matrixSize = gridSize * gridSize; TNL::Matrices::MultidiagonalMatrix< double, Device > matrix( matrixSize, { - gridSize, -1, 0, 1, gridSize }, { { 0.0, 0.0, 1.0 }, // set matrix elements corresponding to boundary grid nodes { 0.0, 0.0, 1.0 }, // and Dirichlet boundary conditions, i.e. 1 on the main diagonal { 0.0, 0.0, 1.0 }, // which is the third one { 0.0, 0.0, 1.0 }, { 0.0, 0.0, 1.0 }, { 0.0, 0.0, 1.0 }, { 0.0, 0.0, 1.0 }, { 0.0, 0.0, 1.0 }, { -1.0, -1.0, 4.0, -1.0, -1.0 }, { -1.0, -1.0, 4.0, -1.0, -1.0 }, { -1.0, -1.0, 4.0, -1.0, -1.0 }, // set matrix elements corresponding to inner grid nodes, i.e.4 on the main diagonal { -1.0, -1.0, 4.0, -1.0, -1.0 }, // (the third one) and -1 to the other sub-diagonals { 0.0, 0.0, 1.0 }, { 0.0, 0.0, 1.0 }, { -1.0, -1.0, 4.0, -1.0, -1.0 }, Loading