We have a group of N items (represented by integers from 1 to N), and we know that there is some total order defined for these items. You may assume that no two elements will be equal (for all a, b: a<b or b<a). However, it is expensive to compare two items. Your task is to make a number of comparisons, and then output the sorted order. The cost of determining if a < b is given by the bth integer of element a of costs (space delimited), which is the same as the ath integer of element b. Naturally, you will be judged on the total cost of the comparisons you make before outputting the sorted order. If your order is incorrect, you will receive a 0. Otherwise, your score will be opt/cost, where opt is the best cost anyone has achieved and cost is the total cost of the comparisons you make (so your score for a test case will be between 0 and 1). Your score for the problem will simply be the sum of your scores for the individual test cases.
Although MATLAB® is a complete, self-contained environment for programming and manipulating data, it is often useful to interact with data and programs external to the MATLAB environment. MATLAB provides an interface to external programs written in the C and Fortran languages. This interface is part of the MATLAB Application Program Interface, or API.
3D FDTD 計(jì)算程序
ToyFDTD1 is a stripped-down, minimalist, 3-dimensional FDTD code that is published under the GNU General Public License. It is the first in the ToyFDTD series of codes, and it illustrates in heavily commented C and Fortran the basic tasks in implementing a simple 3D FDTD simulation.
SuperLU is a general purpose library for the direct solution of large, sparse, nonsymmetric systems of linear equations on high performance machines. The library is written in C and is callable from either C or Fortran. The library routines will perform an LU decomposition with partial pivoting and triangular system solves through forward and back substitution. The LU factorization routines can handle non-square matrices but the triangular solves are performed only for square matrices. The matrix columns may be preordered (before factorization) either through library or user supplied routines. This preordering for sparsity is completely separate from the factorization. Working precision iterative refinement subroutines are provided for improved backward stability. Routines are also provided to equilibrate the system, estimate the condition number, calculate the relative backward error, and estimate error bounds for the refined solutions.
This document specifies a collection of compiler directives, library routines, and
environment variables that can be used to specify shared-memory parallelism in C, C++
and Fortran programs. This functionality collectively defines the specification of the
OpenMP Application Program Interface (OpenMP API). This specification provides a
model for parallel programming that is portable across shared memory architectures
from different vendors. Compilers from numerous vendors support the OpenMP API.
More information about OpenMP can be found at the following web site: