<s> """<STR_LIT>""" <EOL> from __future__ import absolute_import <EOL> from numbers import Number <EOL> import numpy as np <EOL> from multipledispatch import dispatch <EOL> from . base import BaseObject , BaseMatrix , BaseMatrix33 , BaseQuaternion , BaseVector , NpProxy <EOL> from . . import matrix33 <EOL> class Matrix33 ( BaseMatrix33 ) : <EOL> _module = matrix33 <EOL> _shape = ( <NUM_LIT:3> , <NUM_LIT:3> , ) <EOL> m1 = NpProxy ( <NUM_LIT:0> ) <EOL> m2 = NpProxy ( <NUM_LIT:1> ) <EOL> m3 = NpProxy ( <NUM_LIT:2> ) <EOL> m11 = NpProxy ( ( <NUM_LIT:0> , <NUM_LIT:0> ) ) <EOL> m12 = NpProxy ( ( <NUM_LIT:0> , <NUM_LIT:1> ) ) <EOL> m13 = NpProxy ( ( <NUM_LIT:0> , <NUM_LIT:2> ) ) <EOL> m21 = NpProxy ( ( <NUM_LIT:1> , <NUM_LIT:0> ) ) <EOL> m22 = NpProxy ( ( <NUM_LIT:1> , <NUM_LIT:1> ) ) <EOL> m23 = NpProxy ( ( <NUM_LIT:1> , <NUM_LIT:2> ) ) <EOL> m31 = NpProxy ( ( <NUM_LIT:2> , <NUM_LIT:0> ) ) <EOL> m32 = NpProxy ( ( <NUM_LIT:2> , <NUM_LIT:1> ) ) <EOL> m33 = NpProxy ( ( <NUM_LIT:2> , <NUM_LIT:2> ) ) <EOL> r1 = NpProxy ( <NUM_LIT:0> ) <EOL> r2 = NpProxy ( <NUM_LIT:1> ) <EOL> r3 = NpProxy ( <NUM_LIT:2> ) <EOL> c1 = NpProxy ( ( slice ( <NUM_LIT:0> , <NUM_LIT:3> ) , <NUM_LIT:0> ) ) <EOL> c2 = NpProxy ( ( slice ( <NUM_LIT:0> , <NUM_LIT:3> ) , <NUM_LIT:1> ) ) <EOL> c3 = NpProxy ( ( slice ( <NUM_LIT:0> , <NUM_LIT:3> ) , <NUM_LIT:2> ) ) <EOL> @ classmethod <EOL> def from_matrix44 ( cls , matrix , dtype = None ) : <EOL> """<STR_LIT>""" <EOL> return cls ( matrix33 . create_from_matrix44 ( matrix , dtype ) ) <EOL> def __new__ ( cls , value = None , dtype = None ) : <EOL> if value is not None : <EOL> obj = value <EOL> if not isinstance ( value , np . ndarray ) : <EOL> obj = np . array ( value , dtype = dtype ) <EOL> if obj . shape == ( <NUM_LIT:4> , <NUM_LIT:4> ) or isinstance ( obj , Matrix44 ) : <EOL> obj = matrix33 . create_from_matrix44 ( obj , dtype = dtype ) <EOL> elif obj . shape == ( <NUM_LIT:4> , ) or isinstance ( obj , Quaternion ) : <EOL> obj = matrix33 . create_from_quaternion ( obj , dtype = dtype ) <EOL> else : <EOL> obj = np . zeros ( cls . _shape , dtype = dtype ) <EOL> obj = obj . view ( cls ) <EOL> return super ( Matrix33 , cls ) . __new__ ( cls , obj ) <EOL> @ dispatch ( BaseObject ) <EOL> def __add__ ( self , other ) : <EOL> self . _unsupported_type ( '<STR_LIT>' , other ) <EOL> @ dispatch ( BaseObject ) <EOL> def __sub__ ( self , other ) : <EOL> self . _unsupported_type ( '<STR_LIT>' , other ) <EOL> @ dispatch ( BaseObject ) <EOL> def __mul__ ( self , other ) : <EOL> self . _unsupported_type ( '<STR_LIT>' , other ) <EOL> @ dispatch ( BaseObject ) <EOL> def __truediv__ ( self , other ) : <EOL> self . _unsupported_type ( '<STR_LIT>' , other ) <EOL> @ dispatch ( BaseObject ) <EOL> def __div__ ( self , other ) : <EOL> self . _unsupported_type ( '<STR_LIT>' , other ) <EOL> def __invert__ ( self ) : <EOL> return self . inverse <EOL> @ dispatch ( ( BaseMatrix , np . ndarray , list ) ) <EOL> def __add__ ( self , other ) : <EOL> return Matrix33 ( super ( Matrix33 , self ) . __add__ ( Matrix33 ( other ) ) ) <EOL> @ dispatch ( ( BaseMatrix , np . ndarray , list ) ) <EOL> def __sub__ ( self , other ) : <EOL> return Matrix33 ( super ( Matrix33 , self ) . __sub__ ( Matrix33 ( other ) ) ) <EOL> @ dispatch ( ( BaseMatrix , np . ndarray , list ) ) <EOL> def __mul__ ( self , other ) : <EOL> return Matrix33 ( matrix33 . multiply ( self , Matrix33 ( other ) ) ) <EOL> @ dispatch ( BaseQuaternion ) <EOL> def __mul__ ( self , other ) : <EOL> m = other . matrix33 <EOL> return self * m <EOL> @ dispatch ( BaseVector ) <EOL> def __mul__ ( self , other ) : <EOL> return type ( other ) ( matrix33 . apply_to_vector ( self , other ) ) <EOL> @ dispatch ( ( Number , np . number ) ) <EOL> def __add__ ( self , other ) : <EOL> return Matrix33 ( super ( Matrix33 , self ) . __add__ ( other ) ) <EOL> @ dispatch ( ( Number , np . number ) ) <EOL> def __sub__ ( self , other ) : <EOL> return Matrix33 ( super ( Matrix33 , self ) . __sub__ ( other ) ) <EOL> @ dispatch ( ( Number , np . number ) ) <EOL> def __mul__ ( self , other ) : <EOL> return Matrix33 ( super ( Matrix33 , self ) . __mul__ ( other ) ) <EOL> @ dispatch ( ( Number , np . number ) ) <EOL> def __truediv__ ( self , other ) : <EOL> return Matrix33 ( super ( Matrix33 , self ) . __truediv__ ( other ) ) <EOL> @ dispatch ( ( Number , np . number ) ) <EOL> def __div__ ( self , other ) : <EOL> return Matrix33 ( super ( Matrix33 , self ) . __div__ ( other ) ) <EOL> @ property <EOL> def matrix33 ( self ) : <EOL> """<STR_LIT>""" <EOL> return self <EOL> @ property <EOL> def matrix44 ( self ) : <EOL> """<STR_LIT>""" <EOL> return Matrix44 ( self ) <EOL> @ property <EOL> def quaternion ( self ) : <EOL> """<STR_LIT>""" <EOL> return Quaternion ( self ) <EOL> from . matrix44 import Matrix44 <EOL> from . quaternion import Quaternion </s>
