title: How do I seralize Primitive64Matrix in OjAlgo?
body: <p>I'm working on a image classification library, in 100% Java. It does not include deep neural networks. It uses Fisherfaces by OjAlgo. jFaces works very similar to regular machine learning software. Train model and validate it. I want to serialize the model and the model contains only objects of <code>Primitive64Matrix</code></p>
  
  <p><a href="https://github.com/DanielMartensson/jFaces" rel="nofollow noreferrer">https://github.com/DanielMartensson/jFaces</a></p>
  
  <p>How can I serialize <code>Primitive64Matrix</code> in OjAlgo?</p>
  
  <p>I have my class</p>
  
  <pre><code>public class Model implements Serializable{
      private String name;
      //private Primitive64Matrix D;
      private Primitive64Matrix W;
      private Primitive64Matrix P;
      //private long num_components;
      private Primitive64Matrix mu;
      private Primitive64Matrix y;
      public String getName() {
          return name;
      }
      public void setName(String name) {
          this.name = name;
      }
      public Primitive64Matrix getW() {
          return W;
      }
      public void setW(Primitive64Matrix w) {
          W = w;
      }
      public Primitive64Matrix getMu() {
          return mu;
      }
      public void setMu(Primitive64Matrix mu) {
          this.mu = mu;
      }
      public Primitive64Matrix getP() {
          return P;
      }
      public void setP(Primitive64Matrix p) {
          P = p;
      }
      public Primitive64Matrix getY() {
          return y;
      }
      public void setY(Primitive64Matrix y) {
          this.y = y;
      }
  
  }
  </code></pre>
  
  <p>Then I try to save it:</p>
  
  <pre><code>static public void saveModel(Model model,String modelPath) {
      try {
           FileOutputStream fileOut = new FileOutputStream(modelPath);
           ObjectOutputStream out = new ObjectOutputStream(fileOut);
           out.writeObject(model);
           out.close();
           fileOut.close();
           logger.info("Model saved at " + modelPath);
        } catch (IOException e) {
           e.printStackTrace();
        }
  }
  </code></pre>
  
  <p>I get the error:</p>
  
  <pre><code>java.io.NotSerializableException: se.danielmartensson.fisherfaces.Model
      at java.base/java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1185)
      at java.base/java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:349)
      at se.danielmartensson.fisherfaces.tools.SaveLoad.saveModel(SaveLoad.java:22)
      at se.danielmartensson.Main.main(Main.java:123)
  Exception in thread "main" java.lang.NullPointerException
      at se.danielmartensson.Main.main(Main.java:127)
  </code></pre>
  
  <p>OjAlgo is 100% Java, so this must work? Right?</p>