title: Is my shared class thread-safe?
body: <p>I'm going to share a Matrix class between multiple threads in Java. The Matrix class is:
  <a href="https://github.com/vkostyukov/la4j/blob/master/src/main/java/org/la4j/matrix/sparse/CRSMatrix.java" rel="nofollow">https://github.com/vkostyukov/la4j/blob/master/src/main/java/org/la4j/matrix/sparse/CRSMatrix.java</a></p>
  
  <p>and the only method i'm going to call is getting a row which is defined by the following code:</p>
  
  <pre><code>@Override
  public Vector getRow(int i) {
  
      int rowCardinality = rowPointers[i + 1] - rowPointers[i]; 
  
      double rowValues[] = new double[rowCardinality];
      int rowIndices[] = new int[rowCardinality];
  
      System.arraycopy(values, rowPointers[i], rowValues, 0,     rowCardinality);
      System.arraycopy(columnIndices, rowPointers[i], rowIndices, 
                       0, rowCardinality);
  
      return new CompressedVector(columns, rowCardinality, rowValues, 
                                  rowIndices);
  }
  </code></pre>
  
  <p>So it is read-only. Would you please help me to understand if this will cause problems for my multithreaded program or i need to use synchronization or locks?</p>