You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2019/01/23 07:26:07 UTC

[GitHub] avplatonov commented on a change in pull request #5881: IGNITE-10834: Add NamedVector into ML module.

avplatonov commented on a change in pull request #5881: IGNITE-10834: Add NamedVector into ML module.
URL: https://github.com/apache/ignite/pull/5881#discussion_r250078353
 
 

 ##########
 File path: modules/ml/src/main/java/org/apache/ignite/ml/math/primitives/vector/impl/DelegatingNamedVector.java
 ##########
 @@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.ml.math.primitives.vector.impl;
+
+import java.util.Collections;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import org.apache.ignite.ml.math.primitives.vector.NamedVector;
+import org.apache.ignite.ml.math.primitives.vector.Vector;
+import org.omg.CORBA.NamedValue;
+
+/**
+ * Delegating named vector that delegates all operations to underlying vector and adds implementation of
+ * {@link NamedValue} functionality using embedded map that maps string index on real integer index.
+ */
+public class DelegatingNamedVector extends DelegatingVector implements NamedVector {
 
 Review comment:
   I don't like that vector operations hide real type of result - sum of NamedVectors will be Vector. Moreover, there is no checks of keys equality for different NamedVectors. Maybe we need generics?)) 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services