Package dev.nm.misc

Interface DeepCopyable

All Known Subinterfaces:
Matrix, SparseMatrix, Vector
All Known Implementing Classes:
Basis, BidiagonalMatrix, BorderedHessian, ColumnBindMatrix, CombinedVectorByRef, CongruentMatrix, CorrelationMatrix, CSCSparseMatrix, CSRSparseMatrix, DenseData, DenseMatrix, DenseVector, DiagonalMatrix, DiagonalSum, DOKSparseMatrix, FastKroneckerProduct, Ft, FtWt, GivensMatrix, GoldfeldQuandtTrotter, Gradient, Hessian, HilbertMatrix, ImmutableMatrix, ImmutableVector, Inverse, Jacobian, KroneckerProduct, LILSparseMatrix, LowerTriangularMatrix, MAT, MatrixRootByDiagonalization, MatthewsDavies, MultivariateFt, MultivariateFtWt, OuterProduct, PermutationMatrix, PositiveDefiniteMatrixByPositiveDiagonal, PositiveSemiDefiniteMatrixNonNegativeDiagonal, Pow, PseudoInverse, ReturnsMatrix, SampleCovariance, SimilarMatrix, SparseVector, SubMatrixRef, SubVectorRef, SVEC, SymmetricKronecker, SymmetricMatrix, TridiagonalMatrix, UpperTriangularMatrix

public interface DeepCopyable
This interface provides a way to do polymorphic copying.

An interface (a class) that extends (implements) this interface should override the return type of deepCopy() in the interface (class) itself to provide as much information as possible to avoid unnecessary casting.

For example,


 public interface Matrix extends DeepCopyable {
     ...
     Matrix deepCopy();
 }
 
  • Method Summary

    Modifier and Type
    Method
    Description
    The implementation returns an instance created from this by the copy constructor of the class, or just this if the instance itself is immutable.
  • Method Details

    • deepCopy

      Object deepCopy()
      The implementation returns an instance created from this by the copy constructor of the class, or just this if the instance itself is immutable.
      Returns:
      an independent (deep) copy of the instance