tmp
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
* Also add information on how to contact you by electronic and paper mail.
|
||||
******************************************************/
|
||||
|
||||
#include "../lib/core.h"
|
||||
#include "gctl/core/spmat.h"
|
||||
|
||||
using namespace gctl;
|
||||
|
||||
@@ -34,17 +34,26 @@ int main(int argc, char const *argv[]) try
|
||||
spmat<double> mat(5, 5, 0.0);
|
||||
|
||||
std::vector<mat_node<double> > triplts;
|
||||
triplts.push_back(mat_node(0, 1, 0.23));
|
||||
triplts.push_back(mat_node(1, 2, 0.52));
|
||||
triplts.push_back(mat_node(2, 3, 0.31));
|
||||
triplts.push_back(mat_node(2, 3, 0.19));
|
||||
triplts.push_back(mat_node(3, 2, 0.65));
|
||||
triplts.push_back(mat_node(3, 4, 0.8));
|
||||
triplts.push_back(mat_node(4, 3, 1.6));
|
||||
triplts.push_back(mat_node(4, 3, 0.4));
|
||||
triplts.push_back(mat_node<double>(0, 1, 0.23));
|
||||
triplts.push_back(mat_node<double>(1, 2, 0.52));
|
||||
triplts.push_back(mat_node<double>(2, 3, 0.31));
|
||||
triplts.push_back(mat_node<double>(2, 3, 0.19));
|
||||
triplts.push_back(mat_node<double>(3, 2, 0.65));
|
||||
triplts.push_back(mat_node<double>(3, 4, 0.8));
|
||||
triplts.push_back(mat_node<double>(4, 3, 1.6));
|
||||
triplts.push_back(mat_node<double>(4, 3, 0.4));
|
||||
|
||||
mat.set_triplts(triplts, ReplaceVal);
|
||||
mat.init_pattern();
|
||||
|
||||
mat_node<double> n;
|
||||
for (size_t i = 0; i < mat.ele_size(); i++)
|
||||
{
|
||||
n = mat.get_valid_element_copy(i);
|
||||
std::cout << n.r_id << "," << n.c_id << "," << n.val << "\n";
|
||||
}
|
||||
std::cout << "=====\n";
|
||||
|
||||
mat.show_matrix();
|
||||
std::cout << "=====\n";
|
||||
|
||||
|
Reference in New Issue
Block a user