func testAddModeProfile(E_mode float64, N_fmL int, m_fmL float64, N_ox int, m_ox float64, N_fmR int, m_fmR float64) { fmt.Println("Initializing Sparse matrix structure\n") tmp := cmplxSparse.New() matrixSize := int(2 * (N_fmL + N_ox + N_fmR + 2)) fmt.Println("Making sparse ", matrixSize, "x", matrixSize, " Hamiltonian tridiagonal matrix for mode energy test\n") cmplxSparse.MakeHamTriDiag(matrixSize/2, tmp) fmt.Println("Printing sparse ", matrixSize, "x", matrixSize, " Hamiltonian tridiagonal matrix before action\n") cmplxSparse.PrintSparseMatrix(tmp) cmplxSparse.AddModeEnergy(E_mode, N_fmL, m_fmL, N_ox, m_ox, N_fmR, m_fmR, tmp) fmt.Println("Printing sparse ", matrixSize, "x", matrixSize, " Hamiltonian tridiagonal matrix after action\n") cmplxSparse.PrintSparseMatrix(tmp) }
// Function to allow external write access to mode energy variable in // IntegStruct data structure. func (s *IntegStruct) SetMode(ModeEnergy float64) { s.E_mode = ModeEnergy cmplxSparse.AddModeEnergy(-1.0*s.E_mode, s.N_fmL, s.m_fmL, s.N_ox, s.m_ox, s.N_fmR, s.m_fmR, s.Hamiltonian) }