# Path: killMS/Other/ClassTimeIt.py
# class ClassTimeIt():
#     def __init__(self,name="",f=1.):
#         self.t0=timemod.time()
#         self.IsEnable=True
#         if name=="":
#             self.name=name
#         else:
#             self.name=name+": "
#         self.IsEnableIncr=False
#         self.Counter=""
#         self.f=f
# 
#     def reinit(self):
#         self.t0=timemod.time()
# 
#     def timeit(self,stri=" Time",hms=False):
#         if self.IsEnable==False: return
#         t1=timemod.time()
#         dt=self.f*(t1-self.t0)
#         if not(hms):
#             Sout= "  * %s%s %s : %7.5fs"%(self.name,stri,str(self.Counter),dt)
#             if self.IsEnableIncr: self.Counter+=1
#         else:
#             ss=(dt)/60.
#             m=int(ss)
#             s=(ss-m)*60.
#             Sout= "  * %s computation time: %i min. %4.1f sec."%(stri,m,s)
#         self.t0=t1
#         if DoLog:
#             log.print( Sout)
#         else:
#             print(Sout)
# 
#         return dt
# 
#     def timeitHMS(self,stri=" Time"):
#         t1=timemod.time()
#         self.t0=t1
# 
#     def disable(self):
#         self.IsEnable=False
# 
#     def enableIncr(self,incr=1):
#         self.IsEnableIncr=True
#         self.Counter=0
# 
#     def AddDt(self,Var):
#         t1=timemod.time()
#         dt=t1-self.t0
#         Var=Var+dt
#         self.t0=t1
#         return Var


import numpy as np
import dotSSE
import NpDotSSE
from killMS.Other import ClassTimeIt
    print("===================================")
    print("A",A)
    print("B",B)
    if DType==np.complex64:
        IntType=0
    if DType==np.complex128:
        IntType=1

    print("==========")
    dotSSE.dot(A,B,C,IntType)

    print("==========")
    D=np.dot(A,B.T)
    print(C-D)

    #A=np.complex64(np.random.rand(2000,100)+1j*np.random.rand(2000,100))
    A=np.complex64( np.ones((50000,100)))
    B=A.copy()
    #C=np.zeros_like(A)


    N=10
    T=ClassTimeIt.ClassTimeIt()
    for i in range(N):
        AA=np.dot(A.T,B)
        print(AA.shape)
        T.timeit("numpy")

    A=A.T.copy()
    B=B.T.copy()

# Path: killMS/Other/ClassTimeIt.py
# class ClassTimeIt():
#     def __init__(self,name="",f=1.):
#         self.t0=timemod.time()
#         self.IsEnable=True
#         if name=="":
#             self.name=name
#         else:
#             self.name=name+": "
#         self.IsEnableIncr=False
#         self.Counter=""
#         self.f=f
# 
#     def reinit(self):
#         self.t0=timemod.time()
# 
#     def timeit(self,stri=" Time",hms=False):
#         if self.IsEnable==False: return
#         t1=timemod.time()
#         dt=self.f*(t1-self.t0)
#         if not(hms):
#             Sout= "  * %s%s %s : %7.5fs"%(self.name,stri,str(self.Counter),dt)
#             if self.IsEnableIncr: self.Counter+=1
#         else:
#             ss=(dt)/60.
#             m=int(ss)
#             s=(ss-m)*60.
#             Sout= "  * %s computation time: %i min. %4.1f sec."%(stri,m,s)
#         self.t0=t1
#         if DoLog:
#             log.print( Sout)
#         else:
#             print(Sout)
# 
#         return dt
# 
#     def timeitHMS(self,stri=" Time"):
#         t1=timemod.time()
#         self.t0=t1
# 
#     def disable(self):
#         self.IsEnable=False
# 
#     def enableIncr(self,incr=1):
#         self.IsEnableIncr=True
#         self.Counter=0
# 
#     def AddDt(self,Var):
#         t1=timemod.time()
#         dt=t1-self.t0
#         Var=Var+dt
#         self.t0=t1
#         return Var


# Path: killMS/Array/Dot/TestDotSSE.py
import numpy as np
import dotSSE
import NpDotSSE
from killMS.Other import ClassTimeIt

    print("===================================")
    print("A",A)
    print("B",B)
    if DType==np.complex64:
        IntType=0
    if DType==np.complex128:
        IntType=1

    print("==========")
    dotSSE.dot(A,B,C,IntType)

    print("==========")
    D=np.dot(A,B.T)
    print(C-D)

    #A=np.complex64(np.random.rand(2000,100)+1j*np.random.rand(2000,100))
    A=np.complex64( np.ones((50000,100)))
    B=A.copy()
    #C=np.zeros_like(A)


    N=10
    T=ClassTimeIt.ClassTimeIt()
    for i in range(N):
        AA=np.dot(A.T,B)
        print(AA.shape)
        T.timeit("numpy")

    A=A.T.copy()
    B=B.T.copy()

    T=ClassTimeIt.ClassTimeIt()