MCPcopy Create free account
hub / github.com/PyMesh/PyMesh / initialize

Method initialize

tests/learning_tests/swig/Classes.cpp:3–14  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1#include "Classes.h"
2
3void SparseMat::initialize(
4 VectorI& inner_indices, VectorI& outer_indices, VectorF& values) {
5 for (size_t col=0; col < cols(); col++) {
6 const size_t start_idx = outer_indices[col];
7 const size_t end_idx = outer_indices[col+1];
8 for (size_t i=start_idx; i<end_idx; i++) {
9 size_t row = inner_indices[i];
10 Float val = values[i];
11 insert(row, col) = val;
12 }
13 }
14}

Callers 1

initMethod · 0.45

Calls

no outgoing calls

Tested by 1

initMethod · 0.36