parameters: (lhs, name, mode, initial_tabs = 1, max_index=30,aux_dict={})
return_statement: return outstring
docstring: This method converts into text the LHS matrix (only non-zero terms)
  
      Keyword arguments:
      lhs -- The LHS matrix
      name -- The name of the variables
      mode -- The mode of output
      initial_tabs -- The number of tabulations considered
      max_index -- The maximum index
      aux_dict -- Auxiliar dictionary
docstring_summary: This method converts into text the LHS matrix (only non-zero terms)
docstring_tokens: This method converts into text the LHS matrix ( only non - zero terms )
function: def OutputMatrixNonZero(lhs, name, mode, initial_tabs = 1, max_index=30,aux_dict={}):
      """ This method converts into text the LHS matrix (only non-zero terms)
  
      Keyword arguments:
      lhs -- The LHS matrix
      name -- The name of the variables
      mode -- The mode of output
      initial_tabs -- The number of tabulations considered
      max_index -- The maximum index
      aux_dict -- Auxiliar dictionary
      """
      initial_spaces = ""
      for i in range(0,initial_tabs):
          initial_spaces += str("    ")
      outstring = ""
      for i in range(0,lhs.shape[0]):
          for j in range(0,lhs.shape[1]):
              if mode == "python":
                  outstring += initial_spaces+name + "[" + str(i) + "," + str(j) + "]=" + str(lhs[i,j]) + "\n"
              elif mode=="c":
                  if lhs[i,j] != 0:
                      if "// Not supported in C:" in sympy.ccode(lhs[i,j]):
                          var = lhs[i,j]
                          if  "Derivative" in str(var):
                              for constantname, constantexp in aux_dict.items():
                                  var = var.replace(constantname, constantexp)
                              aux_string = str(var)
                              outstring += initial_spaces + name + "(" +str(i)+ "," +str(j) + ")+=" + "//subsvar_" + aux_string.replace("// Not supported in C:","")+ ";\n"
                          else:
                              outstring += initial_spaces + name + "(" +str(i)+ "," +str(j) + ")+=" + "//subsvar_" + sympy.ccode(lhs[i,j]).split("\n",2)[2]+ ";\n"
                      else:
                          outstring += initial_spaces + name + "(" +str(i)+ "," +str(j) + ")+=" + sympy.ccode(lhs[i,j])+ ";\n"
  
      # Matrix entries (two indices)
      for i in range(0,max_index):
          for j in range(0,max_index):
              if mode == "python":
                  replacement_string =  "[" + str(i) + "," + str(j) + "]"
              elif mode=="c":
                  replacement_string =  "(" + str(i) + "," + str(j) + ")"
              to_be_replaced  =  "_" +str(i) + "_" +str(j)
              if not "//subsvar_" in outstring:
                  newstring = outstring.replace(to_be_replaced, replacement_string)
                  outstring = newstring
  
      # Vector entries(one index(
      for i in range(0,max_index):
          replacement_string =  "[" +str(i)+ "]"
          to_be_replaced  =  "_" +str(i)
          if not "//subsvar_" in outstring:
              newstring = outstring.replace(to_be_replaced, replacement_string)
              outstring = newstring
  
      return outstring
function_tokens: def OutputMatrixNonZero ( lhs , name , mode , initial_tabs = 1 , max_index = 30 , aux_dict = { } ) : initial_spaces = "" for i in range ( 0 , initial_tabs ) : initial_spaces += str ( "    " ) outstring = "" for i in range ( 0 , lhs . shape [ 0 ] ) : for j in range ( 0 , lhs . shape [ 1 ] ) : if mode == "python" : outstring += initial_spaces + name + "[" + str ( i ) + "," + str ( j ) + "]=" + str ( lhs [ i , j ] ) + "\n" elif mode == "c" : if lhs [ i , j ] != 0 : if "// Not supported in C:" in sympy . ccode ( lhs [ i , j ] ) : var = lhs [ i , j ] if "Derivative" in str ( var ) : for constantname , constantexp in aux_dict . items ( ) : var = var . replace ( constantname , constantexp ) aux_string = str ( var ) outstring += initial_spaces + name + "(" + str ( i ) + "," + str ( j ) + ")+=" + "//subsvar_" + aux_string . replace ( "// Not supported in C:" , "" ) + ";\n" else : outstring += initial_spaces + name + "(" + str ( i ) + "," + str ( j ) + ")+=" + "//subsvar_" + sympy . ccode ( lhs [ i , j ] ) . split ( "\n" , 2 ) [ 2 ] + ";\n" else : outstring += initial_spaces + name + "(" + str ( i ) + "," + str ( j ) + ")+=" + sympy . ccode ( lhs [ i , j ] ) + ";\n" # Matrix entries (two indices) for i in range ( 0 , max_index ) : for j in range ( 0 , max_index ) : if mode == "python" : replacement_string = "[" + str ( i ) + "," + str ( j ) + "]" elif mode == "c" : replacement_string = "(" + str ( i ) + "," + str ( j ) + ")" to_be_replaced = "_" + str ( i ) + "_" + str ( j ) if not "//subsvar_" in outstring : newstring = outstring . replace ( to_be_replaced , replacement_string ) outstring = newstring # Vector entries(one index( for i in range ( 0 , max_index ) : replacement_string = "[" + str ( i ) + "]" to_be_replaced = "_" + str ( i ) if not "//subsvar_" in outstring : newstring = outstring . replace ( to_be_replaced , replacement_string ) outstring = newstring return outstring