@article{oai:hiroshima-cu.repo.nii.ac.jp:00001174, author = {川端, 英之 and 北村, 俊明 and KAWABATA, Hideyuki and KITAMURA, Toshiaki}, issue = {SIG6(PRO29)}, journal = {情報処理学会論文誌. プログラミング}, month = {May}, note = {application/pdf, 数値計算プログラム記述に広く用いられている言語の1つにMATLABがある.MATLABは各変数が行列を表し,また密行列と疎行列をコード上でほとんど区別なく扱えるので,行列計算を簡潔に記述できる.しかしながらMATLABは動的型言語であるために処理速度に難があり,特に大規模な疎行列を扱う行列計算や頻繁な手続き呼び出しを含む計算には使いにくい.これに対し我々は,行列計算を高速に処理できかつ記述のしやすい言語処理環境の実現を目的とし, MATLABをベースとする記述からCやFortran90などのコンパイル型言語によるプログラムを生成する処理系を開発している.本論文では,このたび新たに改良を加えた行列計算記述向け言語処理系CMCの仕様について述べる.CMCの入力言語はMATLABをベースとし,静的型とすることで実行時のオーバヘッドを極力排除して高速化を図るという方針で設計されており,いくつかの実測により効果が確認されている.しかし,従来の言語仕様は柔軟性に欠けるもので,MATLABとの互換性が十分ではなかった.これに対して,新たに代入による暗黙の変数宣言に対応し,同一名の変数を同一手続き中の複数箇所で別の型で扱うことができるようにした.また,値呼びによる引数授受に対応し,行列添字式の動的チェックや行列サイズの動的拡張を行う箇所をユーザが指定できるようにした.ハウスホルダQR分解を用いた実測により,実行速度を高く保ちながらMATLABとの互換性の高い記述に対応することの可能性が確認できた., MATLAB is a programming language that is used widely for implementing matrix computations. Variables of the MATLAB language are of (sparse or dense) matrix type and operators of the language support matrix computations, so that MATLAB programs tend to be quite simple and readable. However, because of its dynamic nature, the execution speed of programs in MATLAB does not compete with that of codes written in compiled languages such as C or Fortran, especially when computations with large-scale sparse matrices are involved. In order to embody a computational environment where the user can implement efficient programs for matrix computations easily, we have been developing a compiler which translates programs in MATLAB-based language, named CMC, into Fortran 90. The basic idea of our approach for speeding up executions is to adopt static typing while keeping the features of MATLAB as many as possible, and some experimental results have been confirmed that our approach is effective. In this paper, we show new features of CMC. We refined the language specification to make CMC more compatible with MATLAB without loosing the ability of generating fast codes. The modified version of CMC has a few new features. Implicit type declaration with assignment allows the user to deal with variables of different types by the same name. Call-by-value is supported. Dynamic array-bounds checking and enlargement of array will be done at explicitly specified points by the user. Experimental results on Householder QR factorization algorithm have exhibited the effectiveness of CMC's approach.}, pages = {21--36}, title = {行列計算のためのMATLABベース静的型付け言語の設計と実装}, volume = {47}, year = {2006}, yomi = {カワバタ, ヒデユキ and キタムラ, トシアキ} }