Edge* Node::getInEdge(unsigned int index)
{
    if(index<getInSize() && index>=0)
    {
        return inEdges[index];
    }
    return NULL;
}
Exemple #2
0
template <typename num_t> void Tensor<num_t>::setBlock(Matrix<num_t>& mat) {
    if (all_elem_.data() != mat.data()) {
	
	// std::cout << "ENTER setBlock" << std::endl;
	if (mat.row() == getInSize() && mat.col() == getOutSize()) {
	    std::copy(mat.data(),mat.data()+mat.row()*mat.col(),all_elem_.data());
	} else {
	    std::cout << "The Matrix do not correspond with the tensor bonds size\nPass the operation" << std::endl;
	}
    }
    return;
}
Exemple #3
0
template <typename num_t> Matrix<num_t> Tensor<num_t>::getBlock() {
    Matrix<num_t> tmp;
    tmp.point2other(all_elem_.data(),getInSize(),getOutSize());
    return tmp;
}