Beispiel #1
0
// solution is that of the first solver
void AnalysisSolver::correct(vec& res,
                             const system_type& sys,
                             const vec& rhs,
                             real damping) const {
    assert( solvers.size() > 1 );
    solvers.back()->correct(res, sys, rhs, damping);

    if(!dump_qp.getValue().empty() ) {
        const std::string filename = dump_qp.getValue() + ".correction";
        std::ofstream out(filename.c_str());

        write_qp(out, sys, rhs);
    }
}
Beispiel #2
0
// solution is that of the last solver
void AnalysisSolver::solve(vec& res,
                            const system_type& sys,
                            const vec& rhs) const {

    vec backup = res; // backup initial solution

    // start at 1 since 0 is current solver
    for( unsigned i = 1, n = solvers.size(); i < n; ++i ) {
        res = backup;
        solvers[i]->solve(res, sys, rhs);
    }

    if(!dump_qp.getValue().empty() ) {
        const std::string filename = dump_qp.getValue() + ".correction";
        std::ofstream out(filename.c_str());

        write_qp(out, sys, rhs);
    }

}
Beispiel #3
0
int main() {
  struct inode *inode;
  struct file *file;
  char *buffer;
  const char *wbuffer;
  int fd, on;
  size_t count;
  loff_t *ppos;
  poll_table *wait;
  struct file *filp;

  TRACER_init_global_vars__();
  lockStatus = 0;
  qpmouse_init();
  open_qp(inode, file);
  read_qp(file, buffer, count, ppos);	    
  write_qp(file, wbuffer,count, ppos);	   
  poll_qp(file, wait);
  fasync_qp(fd, filp, on);
  release_qp(inode, file);

  if (lockStatus==1) errorFn();
}