The function zip applies the binary function f to the components of two data sets u and v, creating a new data set
r
defined as follows. If m is the length of u and n is the length of v then
r
is a data set of length
min(m, n)
with
r[i] = f(u[i], v[i])
for i in
1 .. min(m, n)
.
If u and v are Matrices of the same size, then zip applies the binary function f to the pairs of corresponding entries of the matrices u and v. The
i, j
-entry of the resulting matrix is
f(u[i, j], v[i, j])
.
If u and v are not both rtables, Arrays, or lists (ie. both are scalars) then
f(u, v)
is returned. If only u is a scalar then
map2(f, u, v)
is computed. If only v is a scalar then
map(f, u, v)
is returned. In other words, zipping a matrix against a scalar is the same as zipping against a same-size matrix filled with that scalar at each entry.
If the optional fourth argument d is given, it is used as a default value for f when one of the data sets is shorter than the other. Thus
r
is a data set of length
max(m, n)
with
r[i] = f(u[i], v[i])
for i in
1 .. min(m, n)
and
r[i] = f(t[i], d)
for
i
in
1 + min(m, n) .. max(m, n)
where
t
is the longer of u and v.
If u and v are Matrices of the same size, then the optional fourth argument is accepted, but ignored. Similarly, if either u or v are not matrices then the fourth argument is also ignored.
If u and v are not Matrices of the same size, then the size of the result is determined by the presence or absence of the optional fourth parameter. If this parameter is omitted in the calling sequence then the result object's dimensions are determined by taking the minimum of the corresponding dimensions of u and v.
The sparse and dense options control how zip is applied to zero data in sparse storage Arrays, Vectors, and Matrices. The zip[sparse] command will apply f for each matched element in the array provided they are not both zero. This scans the actual stored entries (zeros are not stored in sparse arrays). The zip[dense] command will apply f for every matched element in the result index space, as if both input arrays were dense. By default sparse Array inputs, where f(0,0) is non-zero will have the zip[dense] algorithm applied. Sparse Matrix and Vector inputs will have the zip[sparse] algorithm applied by default. The zip[sparse] algorithm is used by default when zipping a sparse matrix against a scalar.
An in-place version of zip is available for Vectors and Matrices, via the LinearAlgebra[Zip] routine.
The function zip applies the binary function f to the components of two data sets u and v, creating a new data set r defined as follows. If m is the length of u and n is the length of v then r is a data set of length min(m, n) with r[i] = f(u[i], v[i]) for i in 1 .. min(m, n). If u and v are Matrices of the same size, then zip applies the binary function f to the pairs of corresponding entries of the matrices u and v. The i, j-entry of the resulting matrix is f(u[i, j], v[i, j]). If u and v are not both rtables, Arrays, or lists (ie. both are scalars) then f(u, v) is returned. If only u is a scalar then map2(f, u, v) is computed. If only v is a scalar then map(f, u, v) is returned. In other words, zipping a matrix against a scalar is the same as zipping against a same-size matrix filled with that scalar at each entry. If the optional fourth argument d is given, it is used as a default value for f when one of the data sets is shorter than the other. Thus r is a data set of length max(m, n) with r[i] = f(u[i], v[i]) for i in 1 .. min(m, n) and r[i] = f(t[i], d) for i in 1 + min(m, n) .. max(m, n) where t is the longer of u and v. If u and v are Matrices of the same size, then the optional fourth argument is accepted, but ignored. Similarly, if either u or v are not matrices then the fourth argument is also ignored. If u and v are not Matrices of the same size, then the size of the result is determined by the presence or absence of the optional fourth parameter. If this parameter is omitted in the calling sequence then the result object's dimensions are determined by taking the minimum of the corresponding dimensions of u and v. The sparse and dense options control how zip is applied to zero data in sparse storage Arrays, Vectors, and Matrices. The zip[sparse] command will apply f for each matched element in the array provided they are not both zero. This scans the actual stored entries (zeros are not stored in sparse arrays). The zip[dense] command will apply f for every matched element in the result index space, as if both input arrays were dense. By default sparse Array inputs, where f(0,0) is non-zero will have the zip[dense] algorithm applied. Sparse Matrix and Vector inputs will have the zip[sparse] algorithm applied by default. The zip[sparse] algorithm is used by default when zipping a sparse matrix against a scalar.An in-place version of zip is available for Vectors and Matrices, via the LinearAlgebra[Zip] routine.
การแปล กรุณารอสักครู่..

ฟังก์ชันซิปใช้ฟังก์ชันทวิภาค f เพื่อส่วนประกอบของข้อมูลสองชุด U และ V , การสร้างข้อมูลชุดใหม่ R
ไว้ดังนี้ ถ้า M คือ ความยาวของ u และ v คือความยาวแล้ว
r
เป็นชุดข้อมูลความยาว
มิน ( m , n )
กับ
r [ i ] = f ( u [ i ] V [ i ] )
1 . . . . . . . สำหรับผมใน มิน ( m , n )
.
ถ้า u และ v เป็นเมทริกซ์ที่มีขนาดเดียวกันแล้วซิปใช้ฟังก์ชันทวิภาค f กับคู่ของรายการที่สอดคล้องกันของเมทริกซ์ U และ V .
, J
- รายการส่งผลให้เมทริกซ์
F ( u [ I , J ] V [ i , J )
.
ถ้า u และ v เป็นทั้ง rtables แถวลำดับ หรือรายการ ( เช่นทั้งสอง scalars ) แล้ว
f ( u , v )
คือกลับมา ถ้าคุณเป็นสเกลาร์แล้ว
map2 ( F , U , V )
จะคำนวณ . ถ้า V เป็นสเกลาร์แล้ว
แผนที่ ( F , U , V )
คือกลับมาในคำอื่น ๆ , ซิป Matrix กับสเกลาร์เป็นแบบซิปกับขนาดเดียวกัน ที่ที่เต็มไปด้วยสเกลาร์เมทริกซ์แต่ละรายการ .
ถ้าตัวเลือกที่สี่อาร์กิวเมนต์ D ให้มันถูกใช้เป็นค่าเริ่มต้นสำหรับ F เมื่อหนึ่งของข้อมูลชุดนั้นสั้นมากกว่าอื่น ๆ ดังนั้น
r
เป็นข้อมูลตั้งค่าความยาวสูงสุด ( m , n )
กับ
r [ i ] = f ( u [ i ] V [ i ] )
1 . . . . . . . สำหรับผมใน มิน ( m , n )
[ i ] และ r = F ( T [ i ]d )
ผม
สำหรับใน 1 นาที ( m , n ) . . . . . . . แม็กซ์ ( m , n )
T ที่เป็นนานของ U และ V .
ถ้า u และ v เป็นเมทริกซ์ที่มีขนาดเดียวกัน แล้วอาร์กิวเมนต์สี่ตัวเลือก ได้รับการยอมรับ แต่ก็ไม่สนใจ ในทำนองเดียวกัน ถ้า U หรือ V ไม่ได้เป็นเมทริกซ์แล้วอาร์กิวเมนต์ที่สี่ยังละเว้น .
ถ้า u และ v เป็นเมทริกซ์ที่มีขนาดเดียวกันแล้วขนาดของผลจะถูกกำหนดโดยการแสดงตนหรือขาดของพารามิเตอร์สี่ตัวเลือก ถ้าพารามิเตอร์นี้ถูกตัดออกในลำดับการเรียกแล้ว ขนาดผลของวัตถุจะถูกกำหนดโดยการขั้นต่ำของมิติที่สอดคล้องกันของ U และ V .
ที่เบาบางและหนาแน่นตัวเลือกการควบคุมวิธีซิปใช้กับศูนย์ข้อมูลในอาร์เรย์ , กระเป๋าโหรงเวกเตอร์และเมทริกซ์รหัสไปรษณีย์ [ มาก ] คำสั่งจะใช้ F สำหรับแต่ละองค์ประกอบในอาร์เรย์โดยตรงกับพวกเขาไม่ได้เป็นทั้งศูนย์ นี้จะสแกนจริงเก็บไว้รายการ ( ศูนย์ไม่ได้เก็บไว้ในป่าโปร่ง อาร์เรย์ ) รหัสไปรษณีย์ [ โง่ ] คำสั่งจะใช้ F ทุกคู่ธาตุ ในผลดัชนีอวกาศ เช่น ถ้าทั้งใส่เรย์อยู่หนาแน่น โดยค่าเริ่มต้นหร็อมแหร็มเรย์ปัจจัยการผลิตที่ F ( 0 ,0 ) คือผลรวมของค่าจะมีซิป [ โง่ ] อัลกอริทึมที่ใช้ และเวกเตอร์เมตริกซ์หร็อมแหร็ม กระผมจะได้ซิป [ มาก ] ขั้นตอนวิธีที่ใช้ค่าปริยาย รหัสไปรษณีย์ [ มาก ] ขั้นตอนวิธีที่ใช้โดยเริ่มต้นเมื่อซิปเมทริกซ์หร็อมแหร็มกับสเกลาร์ .
ในสถานที่รุ่นซิปสามารถใช้ได้สำหรับเวกเตอร์และเมทริกซ์ , ผ่าน linearalgebra
[ Zip ] ตามปกติ
การแปล กรุณารอสักครู่..
