@@ -598,7 +598,7 @@ def get_line_intersection(L3, Ldd):
598
598
Pd = 0.5*(Xdd+Xddd)
599
599
P = -(Pd*ninf*Pd)(1)/(2*(Pd|einf)**2)[0]
600
600
"""
601
- return layout .MultiVector (val_get_line_intersection (L3 .value , Ldd .value ))
601
+ return layout .MultiVector (val_get_line_intersection (L3 .value , Ldd .value ), copy = False )
602
602
603
603
604
604
@numba .njit
@@ -618,15 +618,15 @@ def midpoint_between_lines(L1, L2):
618
618
Gets the point that is maximally close to both lines
619
619
Hadfield and Lasenby AGACSE2018
620
620
"""
621
- return layout .MultiVector (val_midpoint_between_lines (L1 .value , L2 .value ))
621
+ return layout .MultiVector (val_midpoint_between_lines (L1 .value , L2 .value ), copy = False )
622
622
623
623
624
624
def midpoint_of_line_cluster (line_cluster ):
625
625
"""
626
626
Gets a center point of a line cluster
627
627
Hadfield and Lasenby AGACSE2018
628
628
"""
629
- return layout .MultiVector (val_midpoint_of_line_cluster (MVArray (line_cluster ).value ))
629
+ return layout .MultiVector (val_midpoint_of_line_cluster (MVArray (line_cluster ).value ), copy = False )
630
630
631
631
632
632
@numba .njit
@@ -809,7 +809,7 @@ def generate_dilation_rotor(scale):
809
809
if abs (scale - 1.0 ) < 0.00001 :
810
810
u = np .zeros (32 )
811
811
u [0 ] = 1.0
812
- return layout .MultiVector (u )
812
+ return layout .MultiVector (u , copy = False )
813
813
gamma = math .log (scale )
814
814
return math .cosh (gamma / 2 ) + math .sinh (gamma / 2 )* (ninf ^ no )
815
815
@@ -818,7 +818,7 @@ def generate_translation_rotor(euc_vector_a):
818
818
"""
819
819
Generates a rotor that translates objects along the euclidean vector euc_vector_a
820
820
"""
821
- return layout .MultiVector (val_generate_translation_rotor (euc_vector_a .value ))
821
+ return layout .MultiVector (val_generate_translation_rotor (euc_vector_a .value ), copy = False )
822
822
823
823
824
824
@numba .njit
@@ -845,7 +845,7 @@ def meet(A, B):
845
845
The meet algorithm as described in "A Covariant Approach to Geometry"
846
846
I5*((I5*A) ^ (I5*B))
847
847
"""
848
- return layout .MultiVector (meet_val (A .value , B .value ))
848
+ return layout .MultiVector (meet_val (A .value , B .value ), copy = False )
849
849
850
850
851
851
@numba .njit
@@ -878,7 +878,7 @@ def intersect_line_and_plane_to_point(line, plane):
878
878
ans = val_intersect_line_and_plane_to_point (line .value , plane .value )
879
879
if ans [0 ] == - 1. :
880
880
return None
881
- return layout .MultiVector (ans )
881
+ return layout .MultiVector (ans , copy = False )
882
882
883
883
884
884
@numba .njit
@@ -897,7 +897,7 @@ def normalise_n_minus_1(mv):
897
897
"""
898
898
Normalises a conformal point so that it has an inner product of -1 with einf
899
899
"""
900
- return layout .MultiVector (val_normalise_n_minus_1 (mv .value ))
900
+ return layout .MultiVector (val_normalise_n_minus_1 (mv .value ), copy = False )
901
901
902
902
903
903
def quaternion_and_vector_to_rotor (quaternion , vector ):
@@ -952,8 +952,8 @@ def point_pair_to_end_points(T):
952
952
Extracts the end points of a point pair bivector
953
953
"""
954
954
output = val_point_pair_to_end_points (T .value )
955
- A = layout .MultiVector (output [0 , :])
956
- B = layout .MultiVector (output [1 , :])
955
+ A = layout .MultiVector (output [0 , :], copy = False )
956
+ B = layout .MultiVector (output [1 , :], copy = False )
957
957
return A , B
958
958
959
959
@@ -1037,13 +1037,13 @@ def positive_root(sigma):
1037
1037
Square Root of Rotors - Evaluates the positive root
1038
1038
"""
1039
1039
res_val = positive_root_val (sigma .value )
1040
- return layout .MultiVector (res_val )
1040
+ return layout .MultiVector (res_val , copy = False )
1041
1041
1042
1042
1043
1043
def negative_root (sigma ):
1044
1044
""" Square Root of Rotors - Evaluates the negative root """
1045
1045
res_val = negative_root_val (sigma .value )
1046
- return layout .MultiVector (res_val )
1046
+ return layout .MultiVector (res_val , copy = False )
1047
1047
1048
1048
1049
1049
@numba .njit
@@ -1090,7 +1090,7 @@ def val_annihilate_k(K_val, C_val):
1090
1090
1091
1091
def annihilate_k (K , C ):
1092
1092
""" Removes K from C = KX via (K[0] - K[4])*C """
1093
- return layout .MultiVector (val_annihilate_k (K .value , C .value ))
1093
+ return layout .MultiVector (val_annihilate_k (K .value , C .value ), copy = False )
1094
1094
1095
1095
1096
1096
@numba .njit
@@ -1275,7 +1275,7 @@ def motor_between_rounds(X1, X2):
1275
1275
Calculate the motor between any pair of rounds of the same grade
1276
1276
Line up the carriers, then line up the centers
1277
1277
"""
1278
- return layout .MultiVector (val_motor_between_rounds (X1 .value , X2 .value ))
1278
+ return layout .MultiVector (val_motor_between_rounds (X1 .value , X2 .value ), copy = False )
1279
1279
1280
1280
1281
1281
@numba .njit
@@ -1333,7 +1333,7 @@ def motor_between_objects(X1, X2):
1333
1333
"""
1334
1334
Calculates a motor that takes X1 to X2
1335
1335
"""
1336
- return layout .MultiVector (val_motor_between_objects (X1 .value , X2 .value ))
1336
+ return layout .MultiVector (val_motor_between_objects (X1 .value , X2 .value ), copy = False )
1337
1337
1338
1338
1339
1339
def calculate_S_over_mu (X1 , X2 ):
@@ -1492,7 +1492,7 @@ def val_normalised(mv_val):
1492
1492
1493
1493
def normalised (mv ):
1494
1494
""" fast version of the normal() function """
1495
- return layout .MultiVector (val_normalised (mv .value ))
1495
+ return layout .MultiVector (val_normalised (mv .value ), copy = False )
1496
1496
1497
1497
1498
1498
@numba .njit
@@ -1517,12 +1517,12 @@ def val_rotor_between_lines(L1_val, L2_val):
1517
1517
1518
1518
def rotor_between_lines (L1 , L2 ):
1519
1519
""" return the rotor between two lines """
1520
- return layout .MultiVector (val_rotor_between_lines (L1 .value , L2 .value ))
1520
+ return layout .MultiVector (val_rotor_between_lines (L1 .value , L2 .value ), copy = False )
1521
1521
1522
1522
1523
1523
def rotor_between_planes (P1 , P2 ):
1524
1524
""" return the rotor between two planes """
1525
- return layout .MultiVector (val_rotor_rotor_between_planes (P1 .value , P2 .value ))
1525
+ return layout .MultiVector (val_rotor_rotor_between_planes (P1 .value , P2 .value ), copy = False )
1526
1526
1527
1527
1528
1528
@numba .njit
@@ -1614,7 +1614,7 @@ def random_circle():
1614
1614
mv_a = val_random_euc_mv ()
1615
1615
mv_b = val_random_euc_mv ()
1616
1616
mv_c = val_random_euc_mv ()
1617
- return layout .MultiVector (val_normalised (omt_func (omt_func (val_up (mv_a ), val_up (mv_b )), val_up (mv_c ))))
1617
+ return layout .MultiVector (val_normalised (omt_func (omt_func (val_up (mv_a ), val_up (mv_b )), val_up (mv_c ))), copy = False )
1618
1618
1619
1619
1620
1620
def random_sphere_at_origin ():
@@ -1664,7 +1664,7 @@ def val_apply_rotor(mv_val, rotor_val):
1664
1664
1665
1665
def apply_rotor (mv_in , rotor ):
1666
1666
""" Applies rotor to multivector in a fast way """
1667
- return layout .MultiVector (val_apply_rotor (mv_in .value , rotor .value ))
1667
+ return layout .MultiVector (val_apply_rotor (mv_in .value , rotor .value ), copy = False )
1668
1668
1669
1669
1670
1670
@numba .njit
@@ -1675,7 +1675,7 @@ def val_apply_rotor_inv(mv_val, rotor_val, rotor_val_inv):
1675
1675
1676
1676
def apply_rotor_inv (mv_in , rotor , rotor_inv ):
1677
1677
""" Applies rotor to multivector in a fast way takes pre computed adjoint"""
1678
- return layout .MultiVector (val_apply_rotor_inv (mv_in .value , rotor .value , rotor_inv .value ))
1678
+ return layout .MultiVector (val_apply_rotor_inv (mv_in .value , rotor .value , rotor_inv .value ), copy = False )
1679
1679
1680
1680
1681
1681
@numba .njit
@@ -1698,14 +1698,14 @@ def val_convert_2D_polar_line_to_conformal_line(rho, theta):
1698
1698
p1_val = val_convert_2D_point_to_conformal (x1 , y1 )
1699
1699
p2_val = val_convert_2D_point_to_conformal (x2 , y2 )
1700
1700
line_val = omt_func (omt_func (p1_val , p2_val ), ninf_val )
1701
- line_val = line_val / abs (layout .MultiVector (line_val ))
1701
+ line_val = line_val / abs (layout .MultiVector (line_val ), copy = False )
1702
1702
return line_val
1703
1703
1704
1704
1705
1705
def convert_2D_polar_line_to_conformal_line (rho , theta ):
1706
1706
""" Converts a 2D polar line to a conformal line """
1707
1707
line_val = val_convert_2D_polar_line_to_conformal_line (rho , theta )
1708
- return layout .MultiVector (line_val )
1708
+ return layout .MultiVector (line_val , copy = False )
1709
1709
1710
1710
1711
1711
@numba .njit
@@ -1718,7 +1718,7 @@ def val_up(mv_val):
1718
1718
1719
1719
def fast_up (mv ):
1720
1720
""" Fast up mapping """
1721
- return layout .MultiVector (val_up (mv .value ))
1721
+ return layout .MultiVector (val_up (mv .value ), copy = False )
1722
1722
1723
1723
1724
1724
@numba .njit
@@ -1743,14 +1743,14 @@ def val_down(mv_val):
1743
1743
1744
1744
def fast_down (mv ):
1745
1745
""" A fast version of down() """
1746
- return layout .MultiVector (val_down (mv .value ))
1746
+ return layout .MultiVector (val_down (mv .value ), copy = False )
1747
1747
1748
1748
1749
1749
def val_distance_point_to_line (point , line ):
1750
1750
"""
1751
1751
Returns the euclidean distance between a point and a line
1752
1752
"""
1753
- return float (abs (layout .MultiVector (omt_func (point , line ))))
1753
+ return float (abs (layout .MultiVector (omt_func (point , line ))), copy = False )
1754
1754
1755
1755
1756
1756
@numba .njit
@@ -1764,7 +1764,7 @@ def val_convert_2D_point_to_conformal(x, y):
1764
1764
1765
1765
def convert_2D_point_to_conformal (x , y ):
1766
1766
""" Convert a 2D point to conformal """
1767
- return layout .MultiVector (val_convert_2D_point_to_conformal (x , y ))
1767
+ return layout .MultiVector (val_convert_2D_point_to_conformal (x , y ), copy = False )
1768
1768
1769
1769
1770
1770
def distance_polar_line_to_euc_point_2d (rho , theta , x , y ):
@@ -1789,7 +1789,7 @@ def fast_dual(a):
1789
1789
"""
1790
1790
Fast dual
1791
1791
"""
1792
- return layout .MultiVector (dual_func (a .value ))
1792
+ return layout .MultiVector (dual_func (a .value ), copy = False )
1793
1793
1794
1794
1795
1795
class ConformalMVArray (cf .MVArray ):
@@ -1854,7 +1854,7 @@ def from_value_array(value_array):
1854
1854
1855
1855
1856
1856
v_dual = np .vectorize (fast_dual , otypes = [ConformalMVArray ])
1857
- v_new_mv = np .vectorize (lambda v : layout .MultiVector (v ), otypes = [ConformalMVArray ], signature = '(n)->()' )
1857
+ v_new_mv = np .vectorize (lambda v : layout .MultiVector (v ), otypes = [ConformalMVArray ], signature = '(n)->()' , copy = False )
1858
1858
v_up = np .vectorize (fast_up , otypes = [ConformalMVArray ])
1859
1859
v_down = np .vectorize (fast_down , otypes = [ConformalMVArray ])
1860
1860
v_apply_rotor_inv = np .vectorize (apply_rotor_inv , otypes = [ConformalMVArray ])
0 commit comments