code: public static void changeSign(DMatrixSparseCSC A , DMatrixSparseCSC B ) {
          if( A != B ) {
              B.copyStructure(A);
          }
  
          for (int i = 0; i < A.nz_length; i++) {
              B.nz_values[i] = -A.nz_values[i];
          }
      }
docs: B = -A.   Changes the sign of elements in A and stores it in B. A and B can be the same instance.
  
  @param A (Input) Matrix. Not modified.
  @param B (Output) Matrix. Modified.