    const int cols = Load<int>(fin);
    const int nonzeros_num = Load<int>(fin);
    SparseMatrixElements nonzeros(nonzeros_num);
    for (int i = 0; i < nonzeros_num; ++i) {
        const int row = Load<int>(fin);
        const int col = Load<int>(fin);
        const real value = Load<real>(fin);
        nonzeros[i] = Eigen::Triplet<real>(row, col, value);