From 097677ef3fa65b226e6a4c3d5f4200e31ff9ebd4 Mon Sep 17 00:00:00 2001 From: Jiri Pittner Date: Wed, 28 Jan 2026 15:36:53 +0100 Subject: [PATCH] tensor: shares_index implemented --- tensor.cc | 7 +++++++ tensor.h | 3 +++ 2 files changed, 10 insertions(+) diff --git a/tensor.cc b/tensor.cc index 0328ac6..f86f5b7 100644 --- a/tensor.cc +++ b/tensor.cc @@ -2485,6 +2485,13 @@ for(int i=0; i; template class Tensor >; diff --git a/tensor.h b/tensor.h index 0a1f13e..4680e5b 100644 --- a/tensor.h +++ b/tensor.h @@ -231,11 +231,14 @@ int flatposition(int group, int index, const NRVec &shape); int flatposition(const INDEX &i, const NRVec &shape); //position of that index in FLATINDEX INDEX indexposition(int flatindex, const NRVec &shape); //inverse to flatposition + //useful for negative offsets and 0 index excluded bool zero_in_index(const FLATINDEX &); bool zero_in_index(const SUPERINDEX &); bool zero_in_index(const INDEXMATRIX &, const LA_largeindex row); +bool shares_index(const FLATINDEX &I, const FLATINDEX &J); + FLATINDEX superindex2flat(const SUPERINDEX &I); template