7 template<
typename dtype>
12 template<
typename dtype>
20 template<
typename dtype>
25 indices = std::vector<int64_t>(indices_,indices_+n);
29 template<
typename dtype>
33 parent->write(indices.size(),alpha,beta,&indices[0],&values[0]);
37 template<
typename dtype>
39 write(*(
dtype const*)parent->sr->mulid(), &values[0], *(
dtype const*)parent->sr->addid());
41 template<
typename dtype>
43 write(*(
dtype const*)parent->sr->mulid(), values, *(
dtype const*)parent->sr->addid());
46 template<
typename dtype>
48 write(*(
dtype const*)parent->sr->mulid(), &values[0], *(
dtype const*)parent->sr->mulid());
51 template<
typename dtype>
53 write(*(
dtype const*)parent->sr->mulid(), values, *(
dtype const*)parent->sr->mulid());
56 template<
typename dtype>
58 write(-*(
dtype const*)parent->sr->mulid(), &values[0], *(
dtype const*)parent->sr->mulid());
61 template<
typename dtype>
63 write(-*(
dtype const*)parent->sr->mulid(), values, *(
dtype const*)parent->sr->mulid());
66 template<
typename dtype>
70 parent->read(indices.size(),alpha,beta,&indices[0],values);
72 template<
typename dtype>
74 std::vector<dtype> values(indices.size());
75 read(parent->sr->mulid(), &values[0], parent->sr->addid());
79 template<
typename dtype>
82 read(parent->sr->mulid(), values, parent->sr->addid());
void read(dtype alpha, dtype *values, dtype beta)
read the sparse set of indices on the parent tensor to values forall(j) i = indices[j]; values[j] = a...
Sparse_Tensor()
base constructor
void write(dtype alpha, dtype *values, dtype beta)
set the sparse set of indices on the parent tensor to values forall(j) i = indices[j]; parent[i] = be...
void operator-=(std::vector< dtype > values)
a sparse subset of a tensor
void operator=(std::vector< dtype > values)
void operator+=(std::vector< dtype > values)
algstrct * sr
algstrct on which tensor elements and operations are defined
an instance of a tensor within a CTF world