NewMarkAlphaOSI (functions)


siconos.kernel.compareRefFile(array_like (np.float64, 2D) data, str filename, double epsilon, array_like (int, 1D) index=array_like (int, 1D)(), array_like (np.float64, 2D) *ref=0, str mode="ascii", bool verbose=True) → double[source]

Function to load data from a file and compare it with the provided data.

Returns the measured difference between files if the file was loaded and the comparison was performed, which must be >= 0.0, otherwise -1.0 is returned. Caller needs to check diff <= epsilon to verify the result.

Parameters:
  • data – The data to compare against the file.
  • filename – The name of the file to load and compare.
  • epsilon – The comparison threshold.
  • index – An optional list of column indexes, size==0 indicates all columns.
  • ref – If provided, loaded matrix is returned in this pointer.
  • mode – Mode string to pass to ioMatrix::read.
  • verbose – True to print verbose output.
Returns:

  • Positive or 0.0 if the file was loaded and the comparison was performed,
  • otherwise -1.