Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP7560765B2 - Calculation method, calculation device and program - Google Patents
[go: Go Back, main page]

JP7560765B2 - Calculation method, calculation device and program - Google Patents

Calculation method, calculation device and program Download PDF

Info

Publication number
JP7560765B2
JP7560765B2 JP2022564862A JP2022564862A JP7560765B2 JP 7560765 B2 JP7560765 B2 JP 7560765B2 JP 2022564862 A JP2022564862 A JP 2022564862A JP 2022564862 A JP2022564862 A JP 2022564862A JP 7560765 B2 JP7560765 B2 JP 7560765B2
Authority
JP
Japan
Prior art keywords
square root
calculation
result
unit
computer
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2022564862A
Other languages
Japanese (ja)
Other versions
JPWO2022113180A1 (en
Inventor
崇元 佐々木
隆一 谷田
英明 木全
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NTT Inc
NTT Inc USA
Original Assignee
Nippon Telegraph and Telephone Corp
NTT Inc USA
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nippon Telegraph and Telephone Corp, NTT Inc USA filed Critical Nippon Telegraph and Telephone Corp
Publication of JPWO2022113180A1 publication Critical patent/JPWO2022113180A1/ja
Application granted granted Critical
Publication of JP7560765B2 publication Critical patent/JP7560765B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Data Mining & Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Computational Mathematics (AREA)
  • Pure & Applied Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Algebra (AREA)
  • Complex Calculations (AREA)

Description

本発明は、計算方法、計算装置およびプログラムの技術に関する。 The present invention relates to a calculation method, a calculation device and a program technology.

ネットワークや地理情報学、画像工学などの諸分野において、埋め込みグラフというデータ構造が存在する。埋め込みグラフとは、複数の頂点とその頂点同士を結ぶ辺の集合であるグラフと、その頂点位置を合わせて定義したものである。例えばネットワークでは、ネットワークノードを頂点、ネットワークリンクを辺に対応させてグラフを構成できる。このとき、ネットワークノードの物理的な位置や、ネットワークを可視化する際のノード座標を頂点位置に対応させると、埋め込みグラフを見出すことができる。 A data structure called an embedded graph exists in various fields such as networks, geographic information science, and image engineering. An embedded graph is defined by combining a graph, which is a set of multiple vertices and the edges connecting those vertices, with the positions of those vertices. For example, in a network, a graph can be constructed by corresponding network nodes to vertices and network links to edges. In this case, an embedded graph can be found by matching the physical positions of the network nodes or the node coordinates when visualizing the network to the vertex positions.

また、地理情報学であれば、国境や県境、海岸線、湖岸線等の境界線データは一般に、埋め込みグラフとしてデータが保持されている。境界線上に密に頂点をプロットして辺を結ぶことで、境界線を表現している。また、画像工学分野であれば、形状や領域に関するデータの保持に埋め込みグラフが使用される。例えばベクター画像におけるオブジェクト形状、深度マップにおける深度境界線、自然画像の被写体形状やテクスチャ領域形状等のデータは、埋め込みグラフとして表現される。形状や領域の境界上に頂点をプロットすることで、境界線を辺により表現している。In geographic information science, boundary data such as national and prefectural borders, coastlines, and lake shorelines are generally stored as embedded graphs. Boundaries are represented by densely plotting vertices on the boundaries and connecting the edges. In the field of image engineering, embedded graphs are used to store data related to shapes and areas. For example, data such as object shapes in vector images, depth boundaries in depth maps, subject shapes and texture area shapes in natural images are represented as embedded graphs. Boundaries are represented by edges by plotting vertices on the boundaries of shapes and areas.

以上で例示した埋め込みグラフにおいては、埋め込みグラフの形状をできるだけ保ちつつ、頂点数や辺数を可能な限り削減して単純化すること(以下、埋め込みグラフの単純化、あるいは単に単純化と呼ぶ)に大きなメリットがある。 In the embedded graphs shown above, there is a great advantage to simplifying the embedded graph by reducing the number of vertices and edges as much as possible while preserving the shape of the embedded graph as much as possible (hereinafter referred to as simplifying the embedded graph, or simply simplification).

ネットワークにおいては、頂点数、辺数が多いほど詳細なデータを表現できる一方で、一見してネットワーク構成の概要を掴むことが困難になり、加えてデータ量が膨大になるため描画に大きな負荷がかかる。このネットワークについての埋め込みグラフを単純化できれば、ネットワーク構成を視覚的に分かりやすく提示でき、頂点数、辺数を減らしてデータ圧縮し、描画の負荷を低減することが可能になる。地理情報学においては、境界線上に密に頂点をプロットすることで正確に境界線を表現するが、データ量は膨大になってしまう。 In a network, the more vertices and edges there are, the more detailed the data can be expressed, but it also becomes difficult to grasp the overall network configuration at a glance, and the data volume becomes huge, placing a heavy load on drawing. If the embedded graph for this network could be simplified, the network configuration could be presented in a visually easy-to-understand manner, and it would be possible to reduce the number of vertices and edges, compress the data, and reduce the load on drawing. In geographic information studies, boundaries can be accurately represented by densely plotting vertices on the boundaries, but this results in a huge amount of data.

境界線データを単純化することで、データ量を削減して伝送や蓄積が可能な他、境界を簡略した視覚的に分かりやすい地理情報を生成することができる。また画像工学においては、頂点数、辺数が多いほど形状や領域のデータを詳細に保持して正確に表現可能である一方で、データ量が膨大になり、伝送や蓄積に要する符号量が増えてしまう。 By simplifying boundary data, it is possible to reduce the amount of data required for transmission and storage, and to generate geographic information with simplified boundaries that is visually easier to understand. In image engineering, the more vertices and edges there are, the more detailed shape and area data can be retained and more accurately represented, but the amount of data becomes enormous, and the amount of code required for transmission and storage increases.

この形状や領域を単純化できれば、表現の正確性を可能な限り保ちながら、頂点数、辺数を削減して符号量を削減できる。
以上の単純化を達成するための発明として、埋め込みグラフ単純化法が提案されている(特許文献2参照)。またこの高速処理法(2次元版)(特許文献3参照)と、高速処理法(多次元版)(特許文献4参照)とが提案されている。
If this shape and area can be simplified, the number of vertices and edges can be reduced, thereby reducing the amount of code, while maintaining the accuracy of the representation as much as possible.
As an invention for achieving the above simplification, an embedded graph simplification method has been proposed (see Patent Document 2). A high-speed processing method (two-dimensional version) (see Patent Document 3) and a high-speed processing method (multidimensional version) (see Patent Document 4) have also been proposed.

上記の高速処理法では特異値閾値処理(Singular Value Thresholding;SVT)(特許文献4参照)を多数並列に高速計算するFast Multiple SVT(非特許文献1参照)が採用されている。図16にアルゴリズムを掲載する。図16Aと図16Bに示されるアルゴリズムのうちの3行目g-1とh-1と4行目σにおいてはそれぞれ逆数平方根と平方根の差が計算されている。この逆数平方根は図16Aと図16Bに示されるアルゴリズムの計算速度のボトルネックとなっている。 The above high-speed processing method employs Fast Multiple SVT (see Non-Patent Document 1), which performs high-speed calculations of multiple Singular Value Thresholding (SVT) (see Patent Document 4) in parallel. The algorithm is shown in FIG. 16. In the algorithm shown in FIG. 16A and FIG. 16B, the reciprocal square root and the difference between square roots are calculated in the third line g -1 and h -1 and the fourth line σ 2, respectively. This reciprocal square root is the bottleneck in the calculation speed of the algorithm shown in FIG. 16A and FIG. 16B.

また平方根の差の計算は桁落ちが生じやすく、誤差が発生しやすい。さらに、図16Aと図16Bに示されるアルゴリズムのうちの4行目の平方根の差計算においてのみ、平方根の計算が必要であり、その他の個所では逆数平方根しか用いられていない。 In addition, the calculation of the difference between square roots is prone to cancellation of digits, which can easily lead to errors. Furthermore, in the algorithms shown in Figures 16A and 16B, only the square root calculation is required in the square root difference calculation on line 4, and only the reciprocal square root is used in other places.

さて、ある正の実数Aの逆数平方根a=1/√Aは、コンピュータグラフィクス(CG)分野における反射光および分散光シミュレーションにおいて、法線計算という形で多量に繰り返して計算される。Now, the reciprocal square root a = 1/√A of a positive real number A is calculated repeatedly and extensively in the form of normal calculations in reflected light and scattered light simulations in the field of computer graphics (CG).

この計算量を削減するために、高速逆数平方根法(Fast Inverse Square Root;FastInvSqrt法)が発明され、平方根の計算を回避することで、逆数平方根の計算は数倍程度高速化されている。この技術はCGを用いたゲームソフトウェアに実装されている(非特許文献2参照)。またFastInvSqrt法の高精度版として修正FastInvSqrt法が発明されている(非特許文献3参照)。 To reduce the amount of calculation, the Fast Inverse Square Root (FastInvSqrt) method was invented, which speeds up the calculation of the reciprocal square root by several times by avoiding the calculation of the square root. This technology is implemented in game software that uses CG (see Non-Patent Document 2). In addition, a modified FastInvSqrt method has been invented as a high-precision version of the FastInvSqrt method (see Non-Patent Document 3).

このFastInvSqrt法または修正FastInvSqrt法を、上述のFast Multiple SVTにおける逆数平方根の計算に採用することで計算速度の向上が見込まれる。 By adopting this FastInvSqrt method or the modified FastInvSqrt method to calculate the reciprocal square root in the Fast Multiple SVT described above, it is expected that the calculation speed will be improved.

特開2016-221829号公報JP 2016-221829 A 特開2017-211706号公報JP 2017-211706 A 特開2018-082249号公報JP 2018-082249 A 特開2019-046196号公報JP 2019-046196 A

佐々木崇元,北原正樹,清水淳,”低ランク最適化のための高速特異値閾値処理の数理,” 第16回情報科学技術フォーラム,2017Takamoto Sasaki, Masaki Kitahara, Jun Shimizu, "Fast Singular Value Thresholding for Low-Rank Optimization," 16th Forum on Information Science and Technology, 2017 M. Robertson, “A Brief History of InvSqrt,” Bachelor Thesis, University of New Brunswick, 2012.M. Robertson, “A Brief History of InvSqrt,” Bachelor Thesis, University of New Brunswick, 2012. C. J. Walczyk, ''A Modification of the Fast Inverse Square, '' MDPI Computation, vol. 7, no. 3, 2019C. J. Walczyk, ``A Modification of the Fast Inverse Square,'' MDPI Computation, vol. 7, no. 3, 2019

しかしながら、Fast Multiple SVTでは平方根の差計算も必要であるため、結局のところ平方根が必要であり、さらに逆数演算を取る必要が発生する。このため、上記の速度向上は達成されない。However, Fast Multiple SVT requires square root difference calculations, so ultimately the square root is required, and then a reciprocal calculation is required. As a result, the speedup mentioned above is not achieved.

このように、Fast Multiple SVTを用いるグラフ単純化装置は高速に処理できず、グラフ描画やグラフ処理を高速に実行できない。 As such, a graph simplification device using Fast Multiple SVT cannot process quickly, and cannot perform graph drawing or graph processing quickly.

上記事情に鑑み、本発明は、平方根を含む計算をより速く行う技術の提供を目的としている。 In view of the above circumstances, the present invention aims to provide a technology for performing calculations including square roots more quickly.

本発明の一態様は、コンピュータが、正の実数Aの逆数平方根を高速逆数平方根法により計算する第1逆数平方根ステップと、コンピュータが、正の実数Bの逆数平方根を高速逆数平方根法により計算する第2逆数平方根ステップと、コンピュータが、AからBを減算する減算ステップと、コンピュータが、前記第1逆数平方根ステップでの計算結果と、前記第2逆数平方根ステップでの計算結果とを乗算する第1乗算ステップと、コンピュータが、前記第1乗算ステップでの計算結果と、前記減算ステップでの計算結果とを乗算する第2乗算ステップと、コンピュータが、前記第1逆数平方根ステップでの計算結果と、前記第2逆数平方根ステップでの計算結果とを加算する加算ステップと、コンピュータが、前記第2乗算ステップでの計算結果を、前記加算ステップでの計算結果で除算する除算ステップと、を備えた計算方法である。One aspect of the present invention is a calculation method including a first reciprocal square root step in which the computer calculates the reciprocal square root of a positive real number A using the fast reciprocal square root method, a second reciprocal square root step in which the computer calculates the reciprocal square root of a positive real number B using the fast reciprocal square root method, a subtraction step in which the computer subtracts B from A, a first multiplication step in which the computer multiplies the calculation result of the first reciprocal square root step by the calculation result of the second reciprocal square root step, a second multiplication step in which the computer multiplies the calculation result of the first multiplication step by the calculation result of the subtraction step, an addition step in which the computer adds the calculation result of the first reciprocal square root step by the calculation result of the second reciprocal square root step, and a division step in which the computer divides the calculation result of the second multiplication step by the calculation result of the addition step.

本発明の一態様は、上記の計算方法をコンピュータに実行させるためのプログラムである。 One aspect of the present invention is a program for causing a computer to execute the above calculation method.

本発明の一態様は、正の実数Aの逆数平方根を高速逆数平方根法により計算する第1逆数平方根部と、正の実数Bの逆数平方根を高速逆数平方根法により計算する第2逆数平方根部と、AからBを減算する減算部と、前記第1逆数平方根部での計算結果と、前記第2逆数平方根部での計算結果とを乗算する第1乗算部と、前記第1乗算部での計算結果と、前記減算部での計算結果とを乗算する第2乗算部と、前記第1逆数平方根部での計算結果と、前記第2逆数平方根部での計算結果とを加算する加算部と、前記第2乗算部での計算結果を、前記加算部での計算結果で除算する除算部と、を備えた計算装置である。One aspect of the present invention is a calculation device including a first reciprocal square root unit that calculates the reciprocal square root of a positive real number A using the fast reciprocal square root method, a second reciprocal square root unit that calculates the reciprocal square root of a positive real number B using the fast reciprocal square root method, a subtraction unit that subtracts B from A, a first multiplication unit that multiplies the calculation result of the first reciprocal square root unit by the calculation result of the second reciprocal square root unit, a second multiplication unit that multiplies the calculation result of the first multiplication unit by the calculation result of the subtraction unit, an addition unit that adds the calculation result of the first reciprocal square root unit to the calculation result of the second reciprocal square root unit, and a division unit that divides the calculation result of the second multiplication unit by the calculation result of the addition unit.

本発明により、平方根を含む計算をより速く行うことが可能となる。 The present invention makes it possible to perform calculations involving square roots faster.

計算装置を含む情報処理装置の構成を示す図である。FIG. 1 is a diagram illustrating a configuration of an information processing device including a computing device. 計算装置10Aの構成を示すブロック図である。FIG. 2 is a block diagram showing a configuration of a computing device 10A. 計算装置20を示すブロック図である。FIG. 2 is a block diagram showing a computing device 20. 計算量を示す図である。FIG. 計算装置10Bの構成を示すブロック図である。FIG. 2 is a block diagram showing a configuration of a computing device 10B. 計算装置40を示すブロック図である。FIG. 4 is a block diagram showing a computing device 40. 計算装置10Cの構成を示すブロック図である。FIG. 2 is a block diagram showing a configuration of a computing device 10C. 計算装置10Dの構成を示すブロック図である。FIG. 2 is a block diagram showing a configuration of a computing device 10D. 計算装置10Eの構成を示すブロック図である。FIG. 2 is a block diagram showing a configuration of a computing device 10E. 計算装置10Fの構成を示すブロック図である。FIG. 2 is a block diagram showing a configuration of a computing device 10F. グラフの単純化処理の処理概要を示す図である。FIG. 13 is a diagram illustrating an outline of a graph simplification process. グラフ単純化装置の構成例を示す図である。FIG. 1 illustrates an example of the configuration of a graph simplifying device. 局所線形整列部の構成例を示す図である。FIG. 13 is a diagram illustrating an example of the configuration of a local linear alignment unit. 隣接辺のベクトルを並べる操作を説明するための図である。FIG. 13 is a diagram for explaining an operation of arranging vectors of adjacent sides. 局所線形整列問題の解法を示すアルゴリズムを示す図である。FIG. 1 shows an algorithm illustrating the solution to the local linear alignment problem. 局所線形整列問題の解法を示すアルゴリズムを示す図である。FIG. 1 shows an algorithm illustrating the solution to the local linear alignment problem. 特異値閾値処理のアルゴリズムを示す図である。FIG. 1 illustrates an algorithm for singular value threshold processing. 特異値閾値処理のアルゴリズムを示す図である。FIG. 1 illustrates an algorithm for singular value threshold processing.

本発明の実施形態について、図面を参照して詳細に説明する。
図1は、実施形態における計算装置10を含む情報処理装置1の構成を示す図である。情報処理装置1は、入力装置3、計算装置10、および出力装置5を備える。入力装置3は、計算装置10に数値等の入力データを入力する。計算装置10は、入力データを用いて計算を行い、計算結果を出力装置5に出力する。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of the present invention will be described in detail with reference to the drawings.
1 is a diagram showing the configuration of an information processing device 1 including a calculation device 10 in an embodiment. The information processing device 1 includes an input device 3, a calculation device 10, and an output device 5. The input device 3 inputs input data such as numerical values to the calculation device 10. The calculation device 10 performs calculations using the input data and outputs the calculation results to the output device 5.

計算装置10は、バスで接続されたCPU(Central Processing Unit)やメモリや補助記憶装置などを備え、計算プログラムに実行することによって計算処理を実行する。計算装置10の各機能の全て又は一部は、ASIC(Application Specific Integrated Circuit)やPLD(Programmable Logic Device)やFPGA(Field Programmable Gate Array)等のハードウェアを用いて実現されてもよい。計算プログラムは、コンピュータ読み取り可能な記録媒体に記録されてもよい。コンピュータ読み取り可能な記録媒体とは、例えばフレキシブルディスク、光磁気ディスク、ROM、CD-ROM、半導体記憶装置(例えばSSD:Solid State Drive)等の可搬媒体、コンピュータシステムに内蔵されるハードディスク等の記憶装置である。計算プログラムは、電気通信回線を介して送信されてもよい。The computing device 10 includes a CPU (Central Processing Unit), memory, auxiliary storage device, etc., which are connected by a bus, and performs computational processing by executing a computation program. All or part of the functions of the computing device 10 may be realized using hardware such as an ASIC (Application Specific Integrated Circuit), a PLD (Programmable Logic Device), or an FPGA (Field Programmable Gate Array). The computation program may be recorded on a computer-readable recording medium. Examples of computer-readable recording media include portable media such as flexible disks, optical magnetic disks, ROMs, CD-ROMs, and semiconductor storage devices (e.g., SSDs: Solid State Drives), and storage devices such as hard disks built into computer systems. The computation program may be transmitted via a telecommunications line.

以下、計算装置10の第1実施形態~第6実施形態について説明する。その後、計算装置10の適用例としてグラフの単純化処理について説明する。なお、各実施形態における「高速逆数平方根計算部」は、高速逆数平方根法により逆数平方根を計算する。 Below, the first to sixth embodiments of the calculation device 10 will be described. After that, a graph simplification process will be described as an application example of the calculation device 10. Note that the "fast reciprocal square root calculation unit" in each embodiment calculates the reciprocal square root using the fast reciprocal square root method.

[第1実施形態]
以下、第1実施形態における計算装置10である計算装置10Aについて説明する。図2は、実施形態における逆数平方根、および平方根差を計算する計算装置10Aの構成を示すブロック図である。計算装置10Aは、入力装置3から正の実数A、Bが入力され、a=1/√A、b=1/√B、c=√A-√Bを出力装置5に出力する計算装置である。計算装置10Aは、高速逆数平方根計算部11、21、減算部12、乗算部17、117、加算部13、および除算部14を備える。
[First embodiment]
Hereinafter, a calculation device 10A, which is the calculation device 10 in the first embodiment, will be described. Fig. 2 is a block diagram showing the configuration of the calculation device 10A that calculates the reciprocal square root and the square root difference in the embodiment. The calculation device 10A is a calculation device that receives positive real numbers A and B from the input device 3 and outputs a = 1/√A, b = 1/√B, and c = √A - √B to the output device 5. The calculation device 10A includes high-speed reciprocal square root calculation units 11 and 21, a subtraction unit 12, multiplication units 17 and 117, an addition unit 13, and a division unit 14.

計算装置10Aにおいて、正の実数Aが入力されると、Aは、高速逆数平方根計算部11および減算部12に入力される。正の実数Bが入力されると、Bは、高速逆数平方根計算部21および減算部12に入力される。高速逆数平方根計算部11は、減算部12、加算部13、および出力装置5にa=1/√Aを出力する。高速逆数平方根計算部21は、減算部12、加算部13、および出力装置5にb=1/√Bを出力する。減算部12は、A-Bを乗算部117に出力する。When a positive real number A is input to calculation device 10A, A is input to fast reciprocal square root calculation unit 11 and subtraction unit 12. When a positive real number B is input, B is input to fast reciprocal square root calculation unit 21 and subtraction unit 12. Fast reciprocal square root calculation unit 11 outputs a = 1/√A to subtraction unit 12, addition unit 13, and output device 5. Fast reciprocal square root calculation unit 21 outputs b = 1/√B to subtraction unit 12, addition unit 13, and output device 5. Subtraction unit 12 outputs A - B to multiplication unit 117.

乗算部17は、乗算部117にabを出力する。乗算部117は、除算部14に(A-B)abを出力する。加算部13は、a+bを除算部14に出力する。除算部14は、cとして(A-B)ab/(a+b)を出力装置5に出力する。 The multiplication unit 17 outputs ab to the multiplication unit 117. The multiplication unit 117 outputs (A-B)ab to the division unit 14. The addition unit 13 outputs a+b to the division unit 14. The division unit 14 outputs (A-B)ab/(a+b) as c to the output device 5.

ここで、(A-B)ab/(a+b)=√A-√Bであることは、以下の通りである。
√A-√B=(√A-√B)(√A+√B)/(√A+√B)
=(A-B)/(√A+√B)
ここで、
√A+√B=(1/√A+1/√B)(√A√B)=(a+b)/(ab)
よって
(A-B)/(√A+√B)=(A-B)ab/(a+b)
Here, (A-B)ab/(a+b)=√A-√B as follows.
√A-√B=(√A-√B)(√A+√B)/(√A+√B)
=(A-B)/(√A+√B)
Where:
√A+√B=(1/√A+1/√B)(√A√B)=(a+b)/(ab)
Therefore, (A-B)/(√A+√B)=(A-B)ab/(a+b).

以上より、計算装置10Aは、a=1/√A、b=1/√B、およびc=√A-√Bを出力装置5に出力する。計算装置10Aは、逆数平方根を計算するが、√A、√Bは計算していない。よって、cを√A、√Bを計算することなく出力する。また、分子の有理化を行うことで、√A、√Bを計算する場合と比較して、√A-√Bの桁落ちを防止することができる。 From the above, calculation device 10A outputs a = 1/√A, b = 1/√B, and c = √A - √B to output device 5. Calculation device 10A calculates the reciprocal square root, but does not calculate √A or √B. Therefore, it outputs c without calculating √A or √B. Furthermore, by rationalizing the numerator, it is possible to prevent loss of digits in √A - √B compared to when calculating √A and √B.

図3は、参考例として、従来通り、√A、√Bを計算してa,b,cを出力する計算装置20を示すブロック図である。計算装置20は、平方根計算部15、25、減算部22、および除算部24、34を備える。 Figure 3 is a block diagram showing a calculation device 20 that calculates √A and √B and outputs a, b, and c as in the conventional case. The calculation device 20 includes square root calculation units 15 and 25, a subtraction unit 22, and division units 24 and 34.

計算装置20において、正の実数Aが入力されると、平方根計算部15は、減算部22、および除算部24に√Aを出力する。正の実数Bが入力されると、平方根計算部25は、減算部22、および除算部34に√Bを出力する。In the calculation device 20, when a positive real number A is input, the square root calculation unit 15 outputs √A to the subtraction unit 22 and the division unit 24. When a positive real number B is input, the square root calculation unit 25 outputs √B to the subtraction unit 22 and the division unit 34.

除算部24は、a=1/√Aを出力する。除算部34は、b=1/√Bを出力する。減算部22は、c=√A-√Bを出力する。 The division unit 24 outputs a = 1/√A. The division unit 34 outputs b = 1/√B. The subtraction unit 22 outputs c = √A - √B.

ここで計算量を比較するために、図4を用いて各計算の計算量について説明する。図4は、C++言語で、各計算を1,000,000回計算するのに要した時間を、加算を1flopsとして示した図である。図4において、sqrt(x)は平方根,1/sqrt(x)は逆数平方根をC++言語の標準ライブラリ関数によって演算した場合の計算量を示している。また、fastInvSqrt(x)はニュートン法1回のFast Inverse Square Root法による計算量を示している。fastInvSqrt2(x)はニュートン法2回のFast Inverse Square Root法による計算量を示している。fastInvSqrt3(x)はニュートン法3回のFast Inverse Square Root法による計算量を示している。mFastInvSqrt(x)は修正Fast Inverse Square Root法による計算量を示している。 In order to compare the amount of calculations, the amount of calculations for each calculation will be explained using Figure 4. Figure 4 shows the time required to perform each calculation 1,000,000 times in C++, with addition being 1 flop. In Figure 4, sqrt(x) indicates the amount of calculation required to calculate the square root and 1/sqrt(x) indicates the amount of calculation required to calculate the reciprocal square root using standard library functions in C++. Also, fastInvSqrt(x) indicates the amount of calculation required by the Fast Inverse Square Root method using Newton's method once. fastInvSqrt2(x) indicates the amount of calculation required by the Fast Inverse Square Root method using Newton's method twice. fastInvSqrt3(x) indicates the amount of calculation required by the Fast Inverse Square Root method using Newton's method three times. mFastInvSqrt(x) indicates the amount of calculation required by the modified Fast Inverse Square Root method.

また、H.A. Thant, et. al., “Mobile Agents Based Load Balancing Method for Parallel Applications,” 6th Asia-Pacific Symposium on Information and Telecommunication Technologies, Yangon, 2005.によれば、浮動小数点型の加算1回の計算量を同じく1flopとすると、減算、乗算は1flop、除算および平方根計算は4flopsの計算量である。またFastInvSqrt法による逆数平方根演算は、図4に示すとおり、1flopsと見積もることができる。According to H.A. Thant, et. al., “Mobile Agents Based Load Balancing Method for Parallel Applications,” 6th Asia-Pacific Symposium on Information and Telecommunication Technologies, Yangon, 2005, if the computational effort of one floating-point addition is also 1 flop, then subtraction and multiplication require 1 flop, while division and square root calculations require 4 flops. Furthermore, the reciprocal square root calculation using the FastInvSqrt method can be estimated to be 1 flop, as shown in Figure 4.

a、b、cを従来の計算装置20で計算する場合、計算量の総計は17flopsである。一方、本実施形態に係る計算装置10Aで計算する場合、計算量の総計は10flopsである。よって、従来の計算装置20と比較して、本実施形態に係る計算装置10Aでは、7flops、およそ41.2%の浮動小数点演算を削減すると見積もることができる。 When a, b, and c are calculated using a conventional calculation device 20, the total amount of calculation is 17 flops. On the other hand, when calculated using the calculation device 10A according to this embodiment, the total amount of calculation is 10 flops. Therefore, compared to the conventional calculation device 20, it can be estimated that the calculation device 10A according to this embodiment reduces floating-point operations by 7 flops, or approximately 41.2%.

[第2実施形態]
以下、第2実施形態における計算装置10である計算装置10Bについて説明する。図5は、実施形態における、和と差の逆数平方根、および和と差の平方根差を計算する計算装置10Bの構成を示すブロック図である。計算装置10Bは、入力装置3から正の実数X、e(X>e>0)が入力され、a=1/√(X+e)、b=1/√(X-e)、c=√(X+e)-√(X-e)を出力装置5に出力する計算装置である。計算装置10Bは、高速逆数平方根計算部31、41、減算部32、乗算部27、37、47、加算部23、33、および除算部44を備える。
[Second embodiment]
Hereinafter, a calculation device 10B, which is the calculation device 10 in the second embodiment, will be described. Fig. 5 is a block diagram showing the configuration of the calculation device 10B that calculates the reciprocal square root of the sum and the difference, and the square root difference of the sum and the difference, in the embodiment. The calculation device 10B is a calculation device that receives positive real numbers X and e (X>e>0) from the input device 3 and outputs a = 1/√(X+e), b = 1/√(X-e), and c = √(X+e)-√(X-e) to the output device 5. The calculation device 10B includes high-speed reciprocal square root calculation units 31 and 41, a subtraction unit 32, multiplication units 27, 37, and 47, addition units 23 and 33, and a division unit 44.

計算装置10Bにおいて、正の実数Xが入力されると、Xは、加算部23および減算部32に入力される。正の実数eが入力されると、eは、加算部23、減算部32、および乗算部27に入力される。加算部23は、X+eを高速逆数平方根計算部31に出力する。減算部32は、X-eを高速逆数平方根計算部41に出力する。乗算部27は、2eを乗算部47に出力する。 When a positive real number X is input to calculation device 10B, X is input to addition unit 23 and subtraction unit 32. When a positive real number e is input, e is input to addition unit 23, subtraction unit 32, and multiplication unit 27. Addition unit 23 outputs X+e to fast reciprocal square root calculation unit 31. Subtraction unit 32 outputs X-e to fast reciprocal square root calculation unit 41. Multiplication unit 27 outputs 2e to multiplication unit 47.

高速逆数平方根計算部31は、乗算部37、加算部33、および出力装置5にa=1/√(X+e)を出力する。高速逆数平方根計算部41は、乗算部37、加算部33、および出力装置5にb=1/√(X-e)を出力する。乗算部37は、ab=(1/√(X+e))(1/√(X-e))を乗算部47に出力する。乗算部47は、2eabを除算部44に出力する。加算部33は、a+b=1/√(X+e)+1/√(X-e)を除算部44に出力する。除算部44は、cとして2eab/(a+b)を出力装置5に出力する。2eab/(a+b)=√(X+e)-√(X-e)であることは、第1実施形態におけるAをX+eとし、BをX-eとすることで示される。The fast reciprocal square root calculation unit 31 outputs a = 1/√(X+e) to the multiplication unit 37, the addition unit 33, and the output device 5. The fast reciprocal square root calculation unit 41 outputs b = 1/√(X-e) to the multiplication unit 37, the addition unit 33, and the output device 5. The multiplication unit 37 outputs ab = (1/√(X+e)) (1/√(X-e)) to the multiplication unit 47. The multiplication unit 47 outputs 2eab to the division unit 44. The addition unit 33 outputs a + b = 1/√(X+e) + 1/√(X-e) to the division unit 44. The division unit 44 outputs 2eab/(a + b) as c to the output device 5. The fact that 2eab/(a+b)=√(X+e)-√(X-e) can be shown by setting A in the first embodiment to X+e and B to X-e.

以上より、計算装置10Bは、a=1/√(X+e)、b=1/√(X-e)、およびc=√(X+e)-√(X-e)を出力装置5に出力する。計算装置10Bは、逆数平方根を計算するが、√(X+e)、√(X-e)は計算していない。よって、cを√(X+e)、√(X-e)を計算することなく出力する。 From the above, calculation device 10B outputs a = 1/√(X+e), b = 1/√(X-e), and c = √(X+e) - √(X-e) to output device 5. Calculation device 10B calculates the reciprocal square root, but does not calculate √(X+e) or √(X-e). Therefore, it outputs c without calculating √(X+e) or √(X-e).

図6は、参考例として、従来通り、√(X+e)、√(X-e)を計算してa,b,cを出力する計算装置40を示すブロック図である。計算装置40は、平方根計算部35、45、減算部42、52、加算部43、および除算部54、64を備える。 Figure 6 is a block diagram showing, as a reference example, a calculation device 40 that calculates √(X+e) and √(X-e) and outputs a, b, and c as in the conventional manner. The calculation device 40 includes square root calculation units 35 and 45, subtraction units 42 and 52, an addition unit 43, and division units 54 and 64.

計算装置40において、正の実数X、eが入力されると、加算部43は、平方根計算部35に、X+eを出力する。減算部42は、平方根計算部45に、X-eを出力する。平方根計算部35は、除算部54および減算部52に√(X+e)を出力する。平方根計算部45は、除算部64および減算部52に√(X-e)を出力する。 When positive real numbers X and e are input to calculation device 40, addition unit 43 outputs X+e to square root calculation unit 35. Subtraction unit 42 outputs X-e to square root calculation unit 45. Square root calculation unit 35 outputs √(X+e) to division unit 54 and subtraction unit 52. Square root calculation unit 45 outputs √(X-e) to division unit 64 and subtraction unit 52.

除算部54は、a=1/√(X+e)を出力する。除算部64は、b=1/√(X-e)を出力する。減算部52は、c=√(X+e)-√(X-e)を出力する。The division unit 54 outputs a = 1/√(X+e). The division unit 64 outputs b = 1/√(X-e). The subtraction unit 52 outputs c = √(X+e) - √(X-e).

a、b、cを従来の計算装置40で計算する場合、計算量の総計は19flopsである。一方、本実施形態に係る計算装置10Bで計算する場合、計算量の総計は12flopsである。よって、従来の計算装置40と比較して、本実施形態に係る計算装置10Bでは、7flops、およそ36.8%の浮動小数点演算を削減すると見積もることができる。 When a, b, and c are calculated using a conventional calculation device 40, the total amount of calculation is 19 flops. On the other hand, when calculated using the calculation device 10B according to this embodiment, the total amount of calculation is 12 flops. Therefore, compared to the conventional calculation device 40, the calculation device 10B according to this embodiment can be estimated to reduce floating-point operations by 7 flops, or approximately 36.8%.

[第3実施形態]
以下、第3実施形態における計算装置10である計算装置10Cについて説明する。図7は、実施形態における、M×2行列の第2特異値、特異値の和の逆数および特異値の差の逆数を計算する計算装置10Cの構成を示すブロック図である。本実施形態において、M≧3であり、M=2については第4実施形態で説明する。計算装置10Cは、入力装置3からM×2行列Y=[y,y]が入力され、第2特異値σ、特異値の和の逆数1/(σ+σ)および特異値の差の逆数1/(σ-σ)を出力装置5に出力する計算装置である。
[Third embodiment]
Hereinafter, a calculation device 10C, which is the calculation device 10 in the third embodiment, will be described. Fig. 7 is a block diagram showing the configuration of the calculation device 10C in the embodiment, which calculates the second singular value of an M x 2 matrix, the inverse of the sum of the singular values, and the inverse of the difference of the singular values. In this embodiment, M ≥ 3, and M = 2 will be described in the fourth embodiment. The calculation device 10C is a calculation device that receives an M x 2 matrix Y = [y 1 , y 2 ] from the input device 3, and outputs the second singular value σ 2 , the inverse of the sum of the singular values 1/(σ 1 + σ 2 ), and the inverse of the difference of the singular values 1/(σ 1 - σ 2 ) to the output device 5.

計算装置10Cは、第2実施形態で説明した計算装置10Bを備える。また、計算装置10Cは、分解部110、内積部16、26、36、減算部62、乗算部57、67、77、87、加算部53、および平方根計算部55を備える。The calculation device 10C includes the calculation device 10B described in the second embodiment. The calculation device 10C also includes a decomposition unit 110, inner product units 16, 26, and 36, a subtraction unit 62, multiplication units 57, 67, 77, and 87, an addition unit 53, and a square root calculation unit 55.

計算装置10Cにおいて、M×2行列Y=[y,y]が入力されると、Yは、分解部110に入力される。分解部110は、M×2行列Yを列ベクトルy,yに分解する。分解部110は、yを内積部16、36に出力する。分解部110は、yを内積部26、36に出力する。 In the calculation device 10C, when an M×2 matrix Y=[ y1 , y2 ] is input, Y is input to the decomposition unit 110. The decomposition unit 110 decomposes the M×2 matrix Y into column vectors y1 and y2 . The decomposition unit 110 outputs y1 to the inner product units 16 and 36. The decomposition unit 110 outputs y2 to the inner product units 26 and 36.

内積部16は、yとyとの内積aを計算し、aを加算部53、乗算部67、および出力装置5に出力する。内積部26は、yとyとの内積cを計算し、cを加算部53、乗算部67、および出力装置5に出力する。内積部36は、yとyとの内積bを計算し、bを乗算部77、および出力装置5に出力する。 The dot product unit 16 calculates the dot product a between y1 and y1 , and outputs a to the adder unit 53, the multiplier unit 67, and the output device 5. The dot product unit 26 calculates the dot product c between y2 and y2 , and outputs c to the adder unit 53, the multiplier unit 67, and the output device 5. The dot product unit 36 calculates the dot product b between y1 and y2 , and outputs b to the multiplier unit 77 and the output device 5.

加算部53は、f=a+cを計算装置10Bおよび出力装置5に出力する。乗算部67は、acを減算部62に出力する。乗算部77は、bを減算部62に出力する。減算部62は、d=ac-bを平方根計算部55および出力装置5に出力する。平方根計算部55は、e=√dを乗算部57および出力装置5に出力する。乗算部57は、2eを計算装置10Bに出力する。 Addition unit 53 outputs f=a+c to calculation device 10B and output device 5. Multiplication unit 67 outputs ac to subtraction unit 62. Multiplication unit 77 outputs b 2 to subtraction unit 62. Subtraction unit 62 outputs d=ac-b 2 to square root calculation unit 55 and output device 5. Square root calculation unit 55 outputs e=√d to multiplication unit 57 and output device 5. Multiplication unit 57 outputs 2e to calculation device 10B.

計算装置10Bは、1/√(f+2e)を1/(σ+σ)として出力装置5に出力する。計算装置10Bは、1/√(f-2e)を1/(σ-σ)として出力装置5に出力する。計算装置10Bは、√(f+2e)-√(f-2e)を2σとして乗算部87に出力する。乗算部87は、σを出力装置5に出力する。 Calculation device 10B outputs 1/√(f+2e) as 1/(σ 12 ) to output device 5. Calculation device 10B outputs 1/√(f-2e) as 1/(σ 12 ) to output device 5. Calculation device 10B outputs √(f+2e)-√(f-2e) as 2σ 2 to multiplication unit 87. Multiplication unit 87 outputs σ 2 to output device 5.

ここで1/√(f±2e)が1/(σ±σ)であることは、以下の通りである。非特許文献1によれば、M×2行列の特異値σ、σの和および差は、σ±σ=√(tr(YY)±2√(det(YY)))である。 Here, 1/√(f±2e) is 1/(σ 1 ±σ 2 ) as follows: According to Non-Patent Document 1, the sum and difference of the singular values σ 1 and σ 2 of an M×2 matrix are σ 1 ±σ 2 =√(tr(Y T Y)±2√(det(Y T Y))).

tr(YY)=a(=yとyとの内積)+c(=yとyとの内積)=fである。det(YY)=a(=yとyとの内積)×c(=yとyとの内積)-b(=(yとyとの内積b))=ac-b=dある。よって、√(det(YY))=√d=eである。 tr( YTY ) = a (= the dot product of y1 and y1 ) + c (= the dot product of y2 and y2 ) = f. det( YTY ) = a (= the dot product of y1 and y1 ) × c (= the dot product of y2 and y2 ) - b2 (= (the dot product b of y1 and y2 ) 2 ) = ac - b2 = d. Therefore, √(det( YTY )) = √d = e.

よって、√(tr(YY)±2√(det(YY)))=√(f±2e)である。したがって、1/√(f±2e)=1/(σ±σ)である。 Therefore, (tr( YTY )±2(det( YTY )))=(f±2e). Therefore, 1/(f±2e)=1/( σ1 ± σ2 ).

なお、図7に示されるように、計算装置10Cは、第2特異値σ、特異値の和の逆数1/(σ+σ)および特異値の差の逆数1/(σ-σ)だけではなく、a、b、c、d、e、fも出力装置5に出力する。 As shown in FIG. 7, the calculation device 10C outputs not only the second singular value σ 2 , the reciprocal of the sum of the singular values 1/(σ 12 ), and the reciprocal of the difference of the singular values 1/(σ 12 ), but also a, b, c, d, e, and f to the output device 5.

計算装置10Cの計算量について説明する。分解部110の処理は、行列を列ベクトルに分解するだけなので浮動小数点演算は行われない(0flop)。また内積部16、26、36による計算量は、M次列ベクトルの入力に対し、2M-1flopsの計算量である。またsqrtによる平方根計算は前述の通り4flopsである。よって、計算装置10Cによる計算量の総計は6M+19flopsである。上述したように、計算装置10Bにおいて、7flopsの削減効果があるため、計算装置10Cも計算装置10Bによって7flopsの削減効果がある。
[第4実施形態]
以下、第4実施形態における計算装置10である計算装置10Dについて説明する。図8は、実施形態における、2×2行列の第2特異値、特異値の和の逆数および特異値の差の逆数を計算する計算装置10Dの構成を示すブロック図である。計算装置10Dは、入力装置3から2×2行列Y=[y,y]が入力され、第2特異値σ、特異値の和の逆数1/(σ+σ)および特異値の差の逆数1/(σ-σ)を出力装置5に出力する計算装置である。
The computational complexity of the computing device 10C will be described. The processing of the decomposition unit 110 simply decomposes a matrix into column vectors, so no floating-point calculations are performed (0 flops). The computational complexity of the inner product units 16, 26, and 36 is 2M-1 flops for an input of an M-th order column vector. As described above, the square root calculation by sqrt is 4 flops. Therefore, the total computational complexity of the computing device 10C is 6M+19 flops. As described above, the computing device 10B has a reduction effect of 7 flops, so the computing device 10C also has a reduction effect of 7 flops due to the computing device 10B.
[Fourth embodiment]
Hereinafter, a calculation device 10D, which is the calculation device 10 in the fourth embodiment, will be described. Fig. 8 is a block diagram showing the configuration of the calculation device 10D in the embodiment, which calculates the second singular value of a 2x2 matrix, the inverse of the sum of the singular values, and the inverse of the difference of the singular values. The calculation device 10D is a calculation device that receives a 2x2 matrix Y = [ y1 , y2 ] from the input device 3, and outputs the second singular value σ2 , the inverse of the sum of the singular values 1/( σ1 + σ2 ), and the inverse of the difference of the singular values 1/( σ1 - σ2 ) to the output device 5.

計算装置10Dは、第2実施形態で説明した計算装置10Bを備える。また、計算装置10Dは、分解部120、内積部46、56、行列式計算部19、絶対値計算部18、乗算部97、107、および加算部63を備える。The calculation device 10D includes the calculation device 10B described in the second embodiment. The calculation device 10D also includes a decomposition unit 120, inner product units 46 and 56, a determinant calculation unit 19, an absolute value calculation unit 18, multiplication units 97 and 107, and an addition unit 63.

計算装置10Dにおいて、2×2行列Y=[y,y]が入力されると、Yは、分解部120に入力される。分解部120は、2×2行列Yを列ベクトルy,yに分解する。分解部120は、yを内積部46に出力する。分解部120は、yを内積部56に出力する。 In the calculation device 10D, when a 2×2 matrix Y=[y 1 , y 2 ] is input, Y is input to the decomposition unit 120. The decomposition unit 120 decomposes the 2×2 matrix Y into column vectors y 1 and y 2. The decomposition unit 120 outputs y 1 to the inner product unit 46. The decomposition unit 120 outputs y 2 to the inner product unit 56.

内積部46は、yとyとの内積aを計算し、aを加算部63に出力する。内積部56は、yとyとの内積cを計算し、cを加算部63に出力する。行列式計算部19は、Yの行列式dを計算し、dを絶対値計算部18、および出力装置5に出力する。 The inner product unit 46 calculates the inner product a of y1 and y1 , and outputs a to the addition unit 63. The inner product unit 56 calculates the inner product c of y2 and y2 , and outputs c to the addition unit 63. The determinant calculation unit 19 calculates the determinant d of Y, and outputs d to the absolute value calculation unit 18 and the output device 5.

加算部63は、f=a+cを計算装置10Bおよび出力装置5に出力する。絶対値計算部18は、dの絶対値eを乗算部97に出力する。乗算部97は、2eを計算装置10Bに出力する。The addition unit 63 outputs f = a + c to the calculation device 10B and the output device 5. The absolute value calculation unit 18 outputs the absolute value e of d to the multiplication unit 97. The multiplication unit 97 outputs 2e to the calculation device 10B.

計算装置10Bは、1/√(f+2e)を1/(σ+σ)として出力装置5に出力する。計算装置10Bは、1/√(f-2e)を1/(σ-σ)として出力装置5に出力する。計算装置10Bは、√(f+2e)-√(f-2e)を2σとして乗算部107に出力する。乗算部107は、σを出力装置5に出力する。 Calculation device 10B outputs 1/√(f+2e) as 1/(σ 12 ) to output device 5. Calculation device 10B outputs 1/√(f-2e) as 1/(σ 12 ) to output device 5. Calculation device 10B outputs √(f+2e)-√(f-2e) as 2σ 2 to multiplication unit 107. Multiplication unit 107 outputs σ 2 to output device 5.

ここで1/√(f±2e)が1/(σ±σ)であることは、第3実施形態で示した通りである。なお、図8に示されるように、計算装置10Dは、第2特異値σ、特異値の和の逆数1/(σ+σ)および特異値の差の逆数1/(σ-σ)だけではなく、d、fも出力装置5に出力する。 Here, 1/√(f±2e) is 1/(σ 1 ±σ 2 ) as shown in the third embodiment. As shown in Fig. 8, the calculation device 10D outputs not only the second singular value σ 2 , the reciprocal of the sum of the singular values 1/(σ 12 ), and the reciprocal of the difference of the singular values 1/(σ 12 ), but also d and f to the output device 5.

計算装置10Dの計算量について説明する。行列式計算部19の計算量は3flopsである。絶対値計算部18は符号を評価し負の場合に反転させるだけなので浮動小数点演算は行われない(0flop)。計算装置10Dによる計算量の総計は24flopsである。上述したように、計算装置10Bにおいて、7flopsの削減効果があるため、計算装置10Dも計算装置10Bによって7flopsの削減効果がある。
[第5実施形態]
以下、第5実施形態における計算装置10である計算装置10Eについて説明する。図9は、実施形態における、M×2行列のSVTを計算する計算装置10Eの構成を示すブロック図である。本実施形態において、M≧3であり、M=2については第6実施形態で説明する。計算装置10Eは、入力装置3からM×2行列Y=[y,y]と正の実数μが入力され、特異値閾値処理(Singular Value Thresholding;SVT)を行い、その特異値閾値処理結果として、下記(1)に示される行列Zを計算する。
The calculation amount of the calculation device 10D will be described. The calculation amount of the determinant calculation unit 19 is 3 flops. The absolute value calculation unit 18 only evaluates the sign and inverts it if it is negative, so no floating point calculation is performed (0 flops). The total calculation amount by the calculation device 10D is 24 flops. As described above, the calculation device 10B has a reduction effect of 7 flops, so the calculation device 10D also has a reduction effect of 7 flops due to the calculation device 10B.
[Fifth embodiment]
Hereinafter, a calculation device 10E, which is the calculation device 10 in the fifth embodiment, will be described. Fig. 9 is a block diagram showing the configuration of the calculation device 10E in the embodiment, which calculates the SVT of an M x 2 matrix. In this embodiment, M ≥ 3, and M = 2 will be described in the sixth embodiment. The calculation device 10E receives an M x 2 matrix Y = [ y1 , y2 ] and a positive real number μ from the input device 3, performs singular value thresholding (SVT), and calculates a matrix Z shown in the following (1) as a result of the singular value thresholding.

Figure 0007560765000001
Figure 0007560765000001

(1)におけるIは2×2の単位行列である。また、γ、δ、e、a、b、c、dについては後述する。 In (1), I2 is a 2 × 2 unit matrix. γ, δ, e, a, b, c, and d will be described later.

計算装置10Eは、第3実施形態で説明した計算装置10Cと、係数算出装置200と、M×2行列変換装置300とを備える。The calculation device 10E includes the calculation device 10C described in the third embodiment, a coefficient calculation device 200, and an M×2 matrix transformation device 300.

計算装置10Eにおいて、M×2行列Y=[y,y]が入力されると、Yは、計算装置10C、係数算出装置200、およびM×2行列変換装置300に入力される。また、計算装置10Eにおいて、実数μが入力されると、μは、係数算出装置200に入力される。計算装置10Cは、第3実施形態で説明したように、第2特異値σ、特異値の和の逆数1/(σ+σ)、特異値の差の逆数1/(σ-σ)、a、b、c、d、e、fを出力する。ここで、図9に示されるように、g=1/(σ+σ)、h=1/(σ-σ)とする。 When an M×2 matrix Y=[y 1 , y 2 ] is input to the calculation device 10E, Y is input to the calculation device 10C, the coefficient calculation device 200, and the M×2 matrix transformation device 300. When a real number μ is input to the calculation device 10E, μ is input to the coefficient calculation device 200. As described in the third embodiment, the calculation device 10C outputs the second singular value σ 2 , the reciprocal of the sum of the singular values 1/(σ 12 ), the reciprocal of the difference of the singular values 1/(σ 12 ), a, b, c, d, e, and f. Here, as shown in FIG. 9, g=1/(σ 12 ), h=1/(σ 12 ).

計算装置10Cの出力のうち、d、f、σ、g、hは、係数算出装置200に出力される。a、b、c、eは、M×2行列変換装置300に出力される。 Of the outputs of the calculation device 10C, d, f, σ 2 , g, and h are output to the coefficient calculation device 200. A, B, C, and E are output to the M×2 matrix transformation device 300.

係数算出装置200は、d、f、σ、g、h、μが入力される。係数算出装置200は、γ、δを出力する。このγ、δの算出方法について説明する。まず、十分に大きい実数をRとおく。具体的にRの大きさとして、単精度浮動小数点型の最大の数の10分の1程度の大きさが挙げられる。その上で、係数算出装置200は、下記(a)から(d)の4つの場合分けを行うことでγ、δを算出し、それらを出力する。 The coefficient calculation device 200 receives d, f, σ 2 , g, h, and μ as input. The coefficient calculation device 200 outputs γ and δ. The calculation method of γ and δ will be described. First, a sufficiently large real number is set as R. Specifically, the size of R can be about one tenth the maximum number of a single-precision floating-point number. Then, the coefficient calculation device 200 calculates γ and δ by dividing the case into the following four cases (a) to (d), and outputs them.

(a) Yが零行列の場合
(b) (a)に該当せず、d=0の場合
(c) (b)に該当せず、h>Rの場合
(d) (c)に該当しない場合
(a) When Y is a zero matrix. (b) When (a) does not apply and d = 0. (c) When (b) does not apply and h > R. (d) When (c) does not apply.

以下、各場合ごとに出力されるγ、δを示す。なお、高速逆数平方根法による逆数平方根をisqrt(・)と表現することがある。例えば、高速逆数平方根法により計算された正の実数Aの逆数平方根を、isqrt(A)と表現することがある。また、(・)における右下添字の+は、ランプ関数を示す。ランプ関数は、入力が負の実数なら0を出力し、入力が非負の実数なら入力された実数をそのまま出力する。関数minは、入力された数値のうちで最も小さい値を出力する。 The following shows γ and δ output for each case. The reciprocal square root using the fast reciprocal square root method may be expressed as isqrt(·). For example, the reciprocal square root of a positive real number A calculated using the fast reciprocal square root method may be expressed as isqrt(A). The subscript + on the lower right of (·) + indicates a ramp function. The ramp function outputs 0 if the input is a negative real number, and outputs the input real number as is if the input is a non-negative real number. The function min outputs the smallest value among the input numerical values.

(a):γ=0、δ=0
(b):γ=(1-μ×isqrt(f))、δ=0
(c):γ=(1-(√2)×μ×isqrt(f))、δ=0
(d):γ=(1-(μ-σ×h)、δ=min(μ、σ)×g
(a): γ=0, δ=0
(b): γ=(1-μ×isqrt(f)) + , δ=0
(c): γ=(1-(√2)×μ×isqrt(f)) + , δ=0
(d): γ=(1-(μ-σ 2 ) + ×h) + , δ=min(μ, σ 2 )×g

係数算出装置200は、上記場合分けにより、γ、δをM×2行列変換装置300に出力する。これにより、M×2行列変換装置300には、上記(1)に含まれるパラメータが全て揃うため、それらを用いて(1)を出力装置5に出力する。なお、e=0の場合には、(1)におけるγδ/eを0とする。The coefficient calculation device 200 outputs γ and δ to the M×2 matrix transformation device 300 according to the above case distinction. As a result, the M×2 matrix transformation device 300 has all the parameters included in (1) above, and uses them to output (1) to the output device 5. Note that when e=0, γδ/e in (1) is set to 0.

計算装置10Eの計算量について説明する。ランプ関数および関数minは実数値の比較が主な計算処理であり、浮動小数点演算は行われない(0flop)。図16Bに示されるアルゴリズムに従って計算する場合、計算量は12M+38flopsである。一方、計算装置10Eによる計算量の総計は12M+29flopsである。以上より9flopsの浮動小数点演算を削減すると見積もることができる。
[第6実施形態]
以下、第6実施形態における計算装置10である計算装置10Fについて説明する。図10は、実施形態における、2×2行列のSVTを計算する計算装置10Fの構成を示すブロック図である。計算装置10Fは、入力装置3から2×2行列Y=[y,y]と正の実数μが入力され、上述したSVTを行い、その特異値閾値処理結果として、下記(1)に示される行列Zを計算する。なお、yijは、Yのi行j列成分である。
The calculation amount of the calculation device 10E will be described. The ramp function and the function min are mainly calculated by comparing real values, and no floating point calculation is performed (0 flop). When calculating according to the algorithm shown in FIG. 16B, the calculation amount is 12M+38 flops. On the other hand, the total calculation amount by the calculation device 10E is 12M+29 flops. From the above, it can be estimated that 9 flops of floating point calculations will be reduced.
Sixth Embodiment
Hereinafter, a calculation device 10F, which is the calculation device 10 in the sixth embodiment, will be described. Fig. 10 is a block diagram showing the configuration of the calculation device 10F that calculates the SVT of a 2x2 matrix in the embodiment. The calculation device 10F receives the 2x2 matrix Y = [ y1 , y2 ] and a positive real number μ from the input device 3, performs the above-mentioned SVT, and calculates the matrix Z shown in the following (1) as the result of the singular value threshold processing. Note that yij is the i-th row, j-th column component of Y.

Figure 0007560765000002
Figure 0007560765000002

(2)における関数sign(・)は符号関数であり、入力が負の場合には-1を出力し、入力が0の場合には0を出力し、入力が正の場合に+1を出力する。また、γ、δ、dについては後述する。 The function sign(.) in (2) is a sign function that outputs -1 when the input is negative, 0 when the input is 0, and +1 when the input is positive. γ, δ, and d will be explained later.

計算装置10Fは、第4実施形態で説明した計算装置10Dと、係数算出装置201と、2×2行列変換装置301とを備える。The calculation device 10F includes the calculation device 10D described in the fourth embodiment, a coefficient calculation device 201, and a 2x2 matrix transformation device 301.

計算装置10Fにおいて、2×2行列Y=[y,y]が入力されると、Yは、計算装置10D、係数算出装置201、およびM×2行列変換装置301に入力される。また、計算装置10Fにおいて、実数μが入力されると、μは、係数算出装置201に入力される。計算装置10Dは、第3実施形態で説明したように、第2特異値σ、特異値の和の逆数1/(σ+σ)、特異値の差の逆数1/(σ-σ)、d、fを出力する。ここで、図10に示されるように、g=1/(σ+σ)、h=1/(σ-σ)とする。 When a 2×2 matrix Y=[y 1 , y 2 ] is input to the calculation device 10F, Y is input to the calculation device 10D, the coefficient calculation device 201, and the M×2 matrix transformation device 301. When a real number μ is input to the calculation device 10F, μ is input to the coefficient calculation device 201. As described in the third embodiment, the calculation device 10D outputs the second singular value σ 2 , the reciprocal of the sum of the singular values 1/(σ 12 ), the reciprocal of the difference of the singular values 1/(σ 12 ), d, and f. Here, as shown in FIG. 10, g=1/(σ 12 ), and h=1/(σ 12 ).

計算装置10Dの出力のうち、d、f、σ、g、hは、係数算出装置201に出力される。dは、2×2行列変換装置300に出力される。 Of the outputs of the calculation device 10D, d, f, σ 2 , g, and h are output to the coefficient calculation device 201. d is output to the 2×2 matrix transformation device 300.

係数算出装置201は、d、f、σ、g、h、μが入力される。係数算出装置201は、γ、δを出力する。このγ、δの算出方法について説明する。まず、十分に大きい実数をRとおく。具体的にRの大きさとして、単精度浮動小数点型の最大の数の10分の1程度の大きさが挙げられる。その上で、係数算出装置200は、下記(a)から(d)の4つの場合分けを行うことでγ、δを算出し、それらを出力する。 The coefficient calculation device 201 receives d, f, σ 2 , g, h, and μ as input. The coefficient calculation device 201 outputs γ and δ. The calculation method of γ and δ will be described. First, a sufficiently large real number is set as R. Specifically, the size of R can be about one tenth the maximum number of a single-precision floating-point number. Then, the coefficient calculation device 200 calculates γ and δ by dividing the case into the following four cases (a) to (d), and outputs them.

(a) Yが零行列の場合
(b) (a)に該当せず、d=0の場合
(c) (b)に該当せず、h>Rの場合
(d) (c)に該当しない場合
(a) When Y is a zero matrix. (b) When (a) does not apply and d = 0. (c) When (b) does not apply and h > R. (d) When (c) does not apply.

以下、各場合ごとに出力されるγ、δを示す。
(a):γ=0、δ=0
(b):γ=(1-μ×isqrt(f))、δ=0
(c):γ=(1-(√2)×μ×isqrt(f))、δ=0
(d):γ=(1-(μ-σ×h)、δ=min(μ、σ)×g
The following shows γ and δ that are output for each case.
(a): γ=0, δ=0
(b): γ=(1-μ×isqrt(f)) + , δ=0
(c): γ=(1-(√2)×μ×isqrt(f)) + , δ=0
(d): γ=(1-(μ-σ 2 ) + ×h) + , δ=min(μ, σ 2 )×g

係数算出装置200は、上記場合分けにより、γ、δを2×2行列変換装置301に出力する。これにより、2×2行列変換装置301には、上記(2)に含まれるパラメータが全て揃うため、それらを用いて(2)を出力装置5に出力する。The coefficient calculation device 200 outputs γ and δ to the 2×2 matrix transformation device 301 based on the above case distinction. As a result, the 2×2 matrix transformation device 301 has all the parameters included in (2) above, and uses these to output (2) to the output device 5.

計算装置10Fの計算量について説明する。図16Bに示されるアルゴリズムに従って計算する場合、計算量は41flopsである。一方、計算装置10Fによる計算量の総計は32flopsである。以上より9flopsの浮動小数点演算を削減すると見積もることができる。The calculation amount of the calculation device 10F will be described. When calculating according to the algorithm shown in FIG. 16B, the calculation amount is 41 flops. On the other hand, the total calculation amount by the calculation device 10F is 32 flops. From the above, it can be estimated that 9 flops of floating-point operations will be reduced.

次に、グラフの単純化処理について説明する。図11は、グラフの単純化処理の処理概要を示す図である。図11におけるG=(V,E,P)は、M次元空間に埋め込まれたグラフを示す。ここでV,Eはそれぞれ頂点、辺の集合とし、P∈R|V|×Mを頂点座標とする(ここでのRは実数全体の集合)。Pの各行ベクトル(p、(p、…、(p|v|はグラフの各頂点の座標を表す。また、次数が2の頂点の集合をV~={v∈V|degv=2}とする。 Next, the graph simplification process will be described. Fig. 11 is a diagram showing an overview of the graph simplification process. In Fig. 11, G = (V, E, P) indicates a graph embedded in an M-dimensional space. Here, V and E are a set of vertices and edges, respectively, and P ∈ R |V| × M is the vertex coordinates (here, R is the set of all real numbers). Each row vector (p 1 ) T , (p 2 ) T , ..., (p |v| ) T of P represents the coordinates of each vertex of the graph. In addition, the set of vertices with degree 2 is denoted as V~ = {v ∈ V | degv = 2}.

グラフ単純化処理では図11に示される通り、多くの頂点を持つ歪な形状の埋め込みグラフを入力とし、局所的に線形に整列した埋め込みグラフを中間生成し(S101)、最後に不要点を除去して(S102)、形状単純された所望のグラフを得る。In the graph simplification process, as shown in Figure 11, an embedded graph with a distorted shape and many vertices is input, and an embedded graph that is locally linearly aligned is intermediately generated (S101), and finally unnecessary points are removed (S102) to obtain the desired graph with a simplified shape.

図12は、グラフ単純化装置500の構成例を示す図である。グラフ単純化装置500は、閾値λとグラフGが入力され、単純化したグラフG’’を出力する。グラフ単純化装置500は、局所線形整列部510と、不要頂点除去部520とを備える。局所線形整列部510は、グラフGを閾値λを用いて局所線形整列させたG’を不要頂点除去部520に出力する。不要頂点除去部520は、入力したグラフG’の頂点のうち、不要な頂点を除去したG’’を出力する。 Figure 12 is a diagram showing an example configuration of a graph simplification device 500. The graph simplification device 500 receives a threshold λ and a graph G as input, and outputs a simplified graph G". The graph simplification device 500 includes a local linear alignment unit 510 and an unnecessary vertex removal unit 520. The local linear alignment unit 510 outputs G', which is obtained by locally linearly aligning the graph G using the threshold λ, to the unnecessary vertex removal unit 520. The unnecessary vertex removal unit 520 outputs G" in which unnecessary vertices have been removed from the vertices of the input graph G'.

図13は、図12における局所線形整列部510の構成例を示す図である。局所線形整列部510は、上述したように、グラフGを閾値λを用いて局所線形整列させたG’を不要頂点除去部520に出力する。局所線形整列部510は、凸最適化問題立式部511と、凸最適化問題求解部512と、座標情報置換部513とを備える。 Fig. 13 is a diagram showing an example of the configuration of the local linear alignment unit 510 in Fig. 12. As described above, the local linear alignment unit 510 outputs G', which is obtained by locally linearly aligning the graph G using the threshold value λ, to the unnecessary vertex removal unit 520. The local linear alignment unit 510 includes a convex optimization problem formulation unit 511, a convex optimization problem solution unit 512, and a coordinate information replacement unit 513.

最初に凸最適化問題立式部511について説明する。図14は、隣接辺のベクトルを並べる操作を説明するための図である。図14に示される行列Lは、vから隣接する頂点へのベクトル並べるための行列である。図14に示される行列Lの要素について、「…」の箇所は全て0である。また、vの座標がPのk行目としたとき、図14に示されるLにおける「-1」がk列目なっている。LPにより、vを始点としてk-1行目の座標を終点とするベクトルと、vを始点としてk+1行目の座標を終点とするベクトルが得られる。このLを作用させる操作は線形写像である。 First, the convex optimization problem formulation unit 511 will be described. FIG. 14 is a diagram for explaining the operation of arranging vectors of adjacent sides. The matrix L V shown in FIG. 14 is a matrix for arranging vectors from v to adjacent vertices. In the elements of the matrix L V shown in FIG. 14, all the places marked with "..." are 0. Also, when the coordinate of v is the kth row of P, "-1" in L V shown in FIG. 14 is the kth column. By L V P, a vector with v as the starting point and the coordinate of the k-1th row as the end point, and a vector with v as the starting point and the coordinate of the k+1th row as the end point are obtained. The operation of applying this L V is a linear mapping.

元の入力グラフの形を忠実に再現しながらも曲折回数が少なれば、グラフの局所線形整列化に成功したと言える。ここでは忠実再現の尺度をL1ノルムとし、辺の曲折回数の正則化を核型ノルム関数として、凸最適化問題立式部511は、下記(3)のとおり最適化問題を立式する。ここで核型ノルム関数とは入力行列の特異値の和を計算する関数である。

Figure 0007560765000003
If the number of turns is small while faithfully reproducing the shape of the original input graph, it can be said that local linear alignment of the graph has been successful. Here, the measure of faithful reproduction is the L1 norm, and the regularization of the number of turns of an edge is the kernel norm function, and the convex optimization problem formulation unit 511 formulates the optimization problem as shown in (3) below. Here, the kernel norm function is a function that calculates the sum of the singular values of the input matrix.
Figure 0007560765000003

上記(3)の最適化問題を解くために、Primal-Dual Splitting(L. Condat, “A primal-dual splitting method for convex optimization involving lipschitzian, proximable and linear composite terms,” Journal of Optimization Theory and Applications, 2013.参照)を用いる。凸最適化問題求解部512が実行する具体的な手順を図15に示す。図15は、局所線形整列問題の解法を示すアルゴリズムを示す図である。なお、図15の4行目のproxτfにおけるfは、下記(4)である。 In order to solve the optimization problem of (3) above, Primal-Dual Splitting (see L. Condat, "A primal-dual splitting method for convex optimization involving lipschitzian, proximable and linear composite terms," Journal of Optimization Theory and Applications, 2013.) is used. FIG. 15 shows a specific procedure executed by the convex optimization problem solving unit 512. FIG. 15 is a diagram showing an algorithm showing a method for solving the local linear alignment problem. Note that f in prox τf on the fourth line of FIG. 15 is the following (4).

Figure 0007560765000004
Figure 0007560765000004

図15に示されるアルゴリズムでは、3行目から11行目までのn=1からrまでのr回のループの中に、上述したV~に属する元の全てに対して、6行目から10行目までループが行われることが示されている。 In the algorithm shown in Figure 15, in the r loops from n = 1 to r from lines 3 to 11, it is shown that the loops from lines 6 to 10 are performed for all elements belonging to V~ mentioned above.

したがって、6行目から10行目までは、r×(V~に属する元の総数)回実行される。その6行目から10行目のうちの8行目で計算される下記(5)は、核型ノルムの近接写像である。Therefore, lines 6 to 10 are executed r × (total number of elements belonging to V~) times. The following (5), calculated in line 8 of lines 6 to 10, is the proximity map of the kernel type norm.

Figure 0007560765000005
Figure 0007560765000005

上記(5)は、下記(6)の行列の閾値λによるSVTである。

Figure 0007560765000006
The above (5) is an SVT using the threshold value λ of the matrix of the following (6).
Figure 0007560765000006

この8行目の処理は、図15に示されるアルゴリズムの計算時間のうちの約53.8%を占める。そこで、上述した計算装置10E、10Fを用いて上記SVTを計算することで、従来と比較して、グラフ単純化処理を高速に実行することができる。The processing on line 8 takes up approximately 53.8% of the calculation time of the algorithm shown in Figure 15. Therefore, by calculating the SVT using the above-mentioned calculation devices 10E and 10F, the graph simplification process can be executed faster than in the past.

座標情報置換部513は、凸最適化問題求解部512により局所線形整列された頂点座標に座標情報を置換して、局所線形整列させたG’を出力する。The coordinate information replacement unit 513 replaces the coordinate information with the vertex coordinates locally linearly aligned by the convex optimization problem solving unit 512, and outputs the locally linearly aligned G'.

本実施形態は、グラフの単純化だけではなく、SVTを行う全ての処理に適用可能である。例えば、画像偽色除去は、グラフの単純化と同様に、多数の小型行列を正則化する問題に分類される。This embodiment is applicable not only to graph simplification but also to all processes that perform SVT. For example, image false color removal, like graph simplification, is classified as a problem of regularizing a large number of small matrices.

以上説明したように、本実施形態によれば、核型ノルムを特異値を用いずに混合ノルムで表現することで、SVDが不要なSVT計算を実現することで、計算量を削減可能となる。さらに、アルゴリズムを容易にデータ並列化でき、多数の行列について同時処理が可能である。アルゴリズムをデータ並列化できれば、パソコンに搭載されるCPUの多くが採用しているSingle Instrucion Multiple Data(SIMD)等のデータ並列アーキテクチャを用いる実装で高速化できる。As described above, according to this embodiment, the nucleus norm is expressed by a mixed norm without using singular values, thereby realizing SVT calculations that do not require SVD, thereby reducing the amount of calculations. Furthermore, the algorithm can be easily data-parallelized, allowing simultaneous processing of multiple matrices. If the algorithm can be data-parallelized, it can be speeded up by implementing it using a data-parallel architecture such as Single Instruction Multiple Data (SIMD), which is used in many CPUs installed in personal computers.

以上説明した計算装置10A~10Fにおいて、加算部や内積部などの各種計算を行う構成が計算結果を一時的に記憶するメモリなどの記憶装置を設け、この記憶装置に計算結果を一時的に記憶してもよい。In the calculation devices 10A to 10F described above, the configurations that perform various calculations, such as the addition unit and the inner product unit, may be provided with a storage device such as a memory that temporarily stores the calculation results, and the calculation results may be temporarily stored in this storage device.

以上、この発明の実施形態について図面を参照して詳述してきたが、具体的な構成はこの実施形態に限られるものではなく、この発明の要旨を逸脱しない範囲の設計等も含まれる。 Although an embodiment of the present invention has been described in detail above with reference to the drawings, the specific configuration is not limited to this embodiment and also includes designs that do not deviate from the gist of the present invention.

本発明は、平方根の計算を行う計算装置に適用可能である。 The present invention is applicable to a computing device that performs square root calculations.

10、10A、10B、10C、10D、10E、10F、20、40…計算装置、11、21、31、41…高速逆数平方根計算部、12、22、32、42、52…減算部、13、23、33、43、53、63…加算部、14、24、34、44、54、64…除算部、15、25、35、45、55…平方根計算部、16、26、36、46、56…内積部、17、27、37、47、57、67、77、87、97、107、117…乗算部、18…絶対値計算部、19…行列式計算部、110、120…分解部、200、201…係数算出装置、300、301…行列変換装置、500…グラフ単純化装置、510…局所線形整列部、511…凸最適化問題立式部、512…凸最適化問題求解部、513…座標情報置換部、520…不要頂点除去部10, 10A, 10B, 10C, 10D, 10E, 10F, 20, 40... Calculation device, 11, 21, 31, 41... High speed reciprocal square root calculation section, 12, 22, 32, 42, 52... Subtraction section, 13, 23, 33, 43, 53, 63... Addition section, 14, 24, 34, 44, 54, 64... Division section, 15, 25, 35, 45, 55... Square root calculation section, 16, 26, 36, 46, 56... Inner product part, 17, 27 , 37, 47, 57, 67, 77, 87, 97, 107, 117 ... multiplication unit, 18 ... absolute value calculation unit, 19 ... determinant calculation unit, 110, 120 ... decomposition unit, 200, 201 ... coefficient calculation device , 300, 301 ... matrix conversion device, 500 ... graph simplification device, 510 ... local linear alignment unit, 511 ... convex optimization problem formulation unit, 512 ... convex optimization problem solving unit, 513 ... coordinate information replacement unit, 520 …Unnecessary vertex removal section

Claims (7)

コンピュータが、正の実数Aの逆数平方根を高速逆数平方根法により計算する第1逆数平方根ステップと、
コンピュータが、正の実数Bの逆数平方根を高速逆数平方根法により計算する第2逆数平方根ステップと、
コンピュータが、AからBを減算する減算ステップと、
コンピュータが、前記第1逆数平方根ステップでの計算結果と、前記第2逆数平方根ステップでの計算結果とを乗算する第1乗算ステップと、
コンピュータが、前記第1乗算ステップでの計算結果と、前記減算ステップでの計算結果とを乗算する第2乗算ステップと、
コンピュータが、前記第1逆数平方根ステップでの計算結果と、前記第2逆数平方根ステップでの計算結果とを加算する加算ステップと、
コンピュータが、前記第2乗算ステップでの計算結果を、前記加算ステップでの計算結果で除算する除算ステップと、
を備えた計算方法。
a first reciprocal square root step in which the computer calculates the reciprocal square root of a positive real number A by a fast reciprocal square root method;
a second reciprocal square root step in which the computer calculates the reciprocal square root of the positive real number B using a fast reciprocal square root method;
A subtraction step in which the computer subtracts B from A;
a first multiplication step in which the computer multiplies a result of the first reciprocal square root step by a result of the second reciprocal square root step;
a second multiplication step in which the computer multiplies a result of the first multiplication step by a result of the subtraction step;
an addition step in which the computer adds a result of the calculation in the first reciprocal square root step and a result of the calculation in the second reciprocal square root step;
a division step in which the computer divides the result of the second multiplication step by the result of the addition step;
A calculation method that includes:
コンピュータが、正の実数Xと当該実数Xよりも小さい正の実数eとを加算する第1加算ステップと、
コンピュータが、Xからeを減算する減算ステップと、
コンピュータが、eを2倍する第1乗算ステップと、
コンピュータが、前記第1加算ステップでの計算結果の逆数平方根を高速逆数平方根法により計算する第1逆数平方根ステップと、
コンピュータが、前記減算ステップでの計算結果の逆数平方根を高速逆数平方根法により計算する第2逆数平方根ステップと、
コンピュータが、前記第1逆数平方根ステップでの計算結果と、前記第2逆数平方根ステップでの計算結果とを加算する第2加算ステップと、
コンピュータが、前記第1逆数平方根ステップでの計算結果と、前記第2逆数平方根ステップでの計算結果とを乗算する第2乗算ステップと、
コンピュータが、前記第2乗算ステップでの計算結果と、前記減算ステップでの計算結果とを乗算する第3乗算ステップと、
コンピュータが、前記第3乗算ステップでの計算結果を、前記第2加算ステップでの計算結果で除算する除算ステップと、
を備えた計算方法。
a first addition step in which a computer adds a positive real number X and a positive real number e smaller than the real number X;
A subtraction step in which the computer subtracts e from X;
a first multiplication step in which the computer doubles e;
a first reciprocal square root step in which the computer calculates a reciprocal square root of the calculation result in the first addition step by using a fast reciprocal square root method;
a second reciprocal square root step in which the computer calculates a reciprocal square root of the calculation result in the subtraction step by a fast reciprocal square root method;
a second addition step in which the computer adds a result of the calculation in the first reciprocal square root step and a result of the calculation in the second reciprocal square root step;
a second multiplication step in which the computer multiplies a result of the first reciprocal square root step by a result of the second reciprocal square root step;
a third multiplication step in which the computer multiplies a result of the second multiplication step by a result of the subtraction step;
a division step in which the computer divides a result of the third multiplication step by a result of the second addition step;
A calculation method that includes:
コンピュータが、M×2行列を構成する第1列ベクトルと第2列ベクトルのうち、第1列ベクトル同士の内積を計算する第1内積ステップと、
コンピュータが、前記第2列ベクトル同士の内積を計算する第2内積ステップと、
コンピュータが、第1列ベクトルと第2列ベクトルとの内積を計算する第3内積ステップと、
コンピュータが、前記第1内積ステップでの計算結果と、前記第2内積ステップでの計算結果とを加算する加算ステップと、
コンピュータが、前記第1内積ステップでの計算結果と、前記第2内積ステップでの計算結果とを乗算する第1乗算ステップと、
コンピュータが、前記第3内積ステップで計算された内積同士を乗算する第2乗算ステップと、
コンピュータが、前記第1乗算ステップでの計算結果から前記第2乗算ステップでの計算結果を減算する減算ステップと、
コンピュータが、前記減算ステップでの計算結果の平方根を計算する平方根計算ステップと、
コンピュータが、前記平方根計算ステップでの計算結果を2倍する第3乗算ステップと、
を備え、
前記加算ステップでの計算結果をXとし、第3乗算ステップでの計算結果をeとして、請求項2に記載の計算方法により、M×2行列の2つの特異値の和の逆数、2つの特異値の差の逆数、および1つの特異値を計算する計算方法。
a first inner product step in which the computer calculates an inner product between first column vectors among first column vectors and second column vectors that configure an M×2 matrix;
a second dot product step in which the computer calculates a dot product between the second column vectors;
a third dot product step in which the computer calculates an dot product of the first column vector and the second column vector;
an addition step in which a computer adds a calculation result in the first dot product step and a calculation result in the second dot product step;
a first multiplication step in which the computer multiplies a result of the first inner product step by a result of the second inner product step;
a second multiplication step in which the computer multiplies the inner products calculated in the third inner product step;
a subtraction step in which the computer subtracts the calculation result in the second multiplication step from the calculation result in the first multiplication step;
a square root calculation step in which the computer calculates the square root of the calculation result in the subtraction step;
a third multiplication step in which the computer doubles the result of the square root calculation step;
Equipped with
A method for calculating the inverse of the sum of two singular values of an M×2 matrix, the inverse of the difference between two singular values, and one singular value by the method according to claim 2, where the calculation result in the addition step is X and the calculation result in the third multiplication step is e.
請求項3の各ステップを実行し、さらに、請求項3の計算方法より計算された2つの特異値の和の逆数、および2つの特異値の差の逆数を用いて、コンピュータが、M×2行列の特異値閾値処理を計算するステップを備えた計算方法。 A calculation method comprising the steps of executing each step of claim 3 , and further comprising a step of a computer calculating a singular value threshold process of an M×2 matrix using the inverse of the sum of two singular values and the inverse of the difference of the two singular values calculated by the calculation method of claim 3. コンピュータが、M次元空間のグラフの頂点を局所的に線形に整列する整列ステップと、
コンピュータが、前記整列ステップにおいて線形に整列されたグラフの頂点のうち、頂点同士を結ぶ辺のなす角度に基づき、不要な辺と頂点とを除去する除去ステップと、
を備え、
前記整列ステップにおいて、特異値の和を計算する核型ノルム関数による特異値閾値処理を前記請求項4に記載の計算方法で行う計算方法。
An alignment step in which a computer locally linearly aligns vertices of a graph in an M-dimensional space;
a removing step in which the computer removes unnecessary edges and vertices from the vertices of the graph linearly arranged in the sorting step, based on angles between edges connecting the vertices;
Equipped with
The method according to claim 4, wherein in the alignment step, singular value threshold processing is performed using a kernicrotype norm function that calculates the sum of singular values.
請求項1から請求項5のいずれか1項に記載の計算方法をコンピュータに実行させるためのプログラム。 A program for causing a computer to execute the calculation method according to any one of claims 1 to 5. 正の実数Aの逆数平方根を高速逆数平方根法により計算する第1逆数平方根部と、
正の実数Bの逆数平方根を高速逆数平方根法により計算する第2逆数平方根部と、
AからBを減算する減算部と、
前記第1逆数平方根部での計算結果と、前記第2逆数平方根部での計算結果とを乗算する第1乗算部と、
前記第1乗算部での計算結果と、前記減算部での計算結果とを乗算する第2乗算部と、
前記第1逆数平方根部での計算結果と、前記第2逆数平方根部での計算結果とを加算する加算部と、
前記第2乗算部での計算結果を、前記加算部での計算結果で除算する除算部と、
を備えた計算装置。
a first reciprocal square root unit that calculates a reciprocal square root of a positive real number A by a fast reciprocal square root method;
a second reciprocal square root unit that calculates the reciprocal square root of a positive real number B by a fast reciprocal square root method;
A subtraction unit that subtracts B from A;
a first multiplication unit that multiplies a calculation result in the first reciprocal square root unit by a calculation result in the second reciprocal square root unit;
a second multiplication unit that multiplies a result of the calculation in the first multiplication unit by a result of the calculation in the subtraction unit;
an adder that adds a calculation result of the first reciprocal square root unit and a calculation result of the second reciprocal square root unit;
a division unit that divides a calculation result in the second multiplication unit by a calculation result in the addition unit;
A computing device comprising:
JP2022564862A 2020-11-25 2020-11-25 Calculation method, calculation device and program Active JP7560765B2 (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2020/043722 WO2022113180A1 (en) 2020-11-25 2020-11-25 Calculation method, calculation device, and program

Publications (2)

Publication Number Publication Date
JPWO2022113180A1 JPWO2022113180A1 (en) 2022-06-02
JP7560765B2 true JP7560765B2 (en) 2024-10-03

Family

ID=81754217

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2022564862A Active JP7560765B2 (en) 2020-11-25 2020-11-25 Calculation method, calculation device and program

Country Status (2)

Country Link
JP (1) JP7560765B2 (en)
WO (1) WO2022113180A1 (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020039454A1 (en) 2000-06-15 2002-04-04 Lifef/X Networks, Inc. And Auckland Uniservices Li Basis functions of three-dimensional models for compression, transformation and streaming

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6810003B2 (en) * 2017-09-01 2021-01-06 日本電信電話株式会社 Matrix simplification device, program, and matrix simplification method

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020039454A1 (en) 2000-06-15 2002-04-04 Lifef/X Networks, Inc. And Auckland Uniservices Li Basis functions of three-dimensional models for compression, transformation and streaming

Also Published As

Publication number Publication date
WO2022113180A1 (en) 2022-06-02
JPWO2022113180A1 (en) 2022-06-02

Similar Documents

Publication Publication Date Title
Wang et al. Rapid generation of optimal generalized Monkhorst-Pack grids
JP7186797B2 (en) Method and system for quantum computing
Liang et al. Solving partial differential equations on point clouds
Passieux et al. Classic and inverse compositional Gauss‐Newton in global DIC
CN112634149B (en) Point cloud denoising method based on graph convolution network
EP3144805B1 (en) Method and processing apparatus for performing arithmetic operation
WO2020221583A1 (en) System and method for molecular design on a quantum computer
Xu et al. Order-encoded quantum image model and parallel histogram specification: G. Xu et al.
Peng et al. MBFQuant: A multiplier-bitwidth-fixed, mixed-precision quantization method for mobile CNN-based applications
CN113888697A (en) A three-dimensional reconstruction method in the state of two-hand interaction
JP2005535951A (en) Image model based on n-pixel and defined by algebraic topology, and application based thereon
Chen et al. GPU-based polygonization and optimization for implicit surfaces
US10936938B2 (en) Method for visualizing neural network models
JP7450220B2 (en) Quantum computers, programs, quantum calculation methods and quantum circuits
Chen et al. Hrnet: Hamiltonian rescaling network for image downscaling
CN103310216B (en) Based on the mode identification method protecting inner product dimensionality reduction technology
US20250013904A1 (en) Quantum controlled operations in two-dimensional quantum computing systems
JP7560765B2 (en) Calculation method, calculation device and program
JP6810003B2 (en) Matrix simplification device, program, and matrix simplification method
Zhou et al. Quantum multidimensional color images similarity comparison
CA3197435A1 (en) Multi-dimensional logarithmic number system processor for inner product computations
Cai et al. Integer multiple quantum image scaling based on NEQR and bicubic interpolation
CN106454382B (en) A kind of quantum image preparation method
Čomić et al. Repairing binary images through the 2D diamond grid
Nagai et al. Simulation of Continuous-Variable Quantum Systems with Tensor Network

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20230222

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20240206

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20240228

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20240514

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20240709

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A821

Effective date: 20240709

A911 Transfer to examiner for re-examination before appeal (zenchi)

Free format text: JAPANESE INTERMEDIATE CODE: A911

Effective date: 20240731

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20240820

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20240902

R150 Certificate of patent or registration of utility model

Ref document number: 7560765

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350