about summary refs log tree commit diff
path: root/sourcecodes/bnt-master/BNT/potentials/@dpot/multiply_by_pot.m
diff options
context:
space:
mode:
Diffstat (limited to 'sourcecodes/bnt-master/BNT/potentials/@dpot/multiply_by_pot.m')
-rw-r--r--sourcecodes/bnt-master/BNT/potentials/@dpot/multiply_by_pot.m13
1 files changed, 13 insertions, 0 deletions
diff --git a/sourcecodes/bnt-master/BNT/potentials/@dpot/multiply_by_pot.m b/sourcecodes/bnt-master/BNT/potentials/@dpot/multiply_by_pot.m
new file mode 100644
index 00000000..ad7caaa7
--- /dev/null
+++ b/sourcecodes/bnt-master/BNT/potentials/@dpot/multiply_by_pot.m
@@ -0,0 +1,13 @@
+function Tbig = multiply_by_pot(Tbig, Tsmall)
+% MULTIPLY_BY_POT Tbig *= Tsmall
+% Tbig = multiply_by_pot(Tbig, Tsmall)
+%
+% Tsmall's domain must be a subset of Tbig's domain.
+
+%process sparse dpot, we do not consider only one of the two pots is sparse
+if issparse(Tbig.T) && issparse(Tsmall.T)
+   Tbig.T = mult_by_sparse_table(Tbig.T, Tbig.domain, Tbig.sizes, Tsmall.T, Tsmall.domain, Tsmall.sizes);
+else 
+   Tbig.T = mult_by_table(Tbig.T, Tbig.domain, Tbig.sizes, Tsmall.T, Tsmall.domain, Tsmall.sizes);
+end
+